The sun and the moon were created by the end of the first day. What you
see in Genesis 1:14-16 is that now, for the first time, the sun and the
moon became visible from the earth’s surface. In the early history of the
earth, there was a very thick atmosphere containing substances such as
methane ammonia and other things no longer there. This thick atmosphere,
somewhat like Venus today (the sun never shines on Venus at all because of
the atmosphere) prevented the sun and moon from shining on the earth. But
as life was created on earth (and perhaps even evolved some) it changed
the atmosphere so that by the fourth “day” the sun and moon became visible
to those on the earth.
John Oakes, Ph.D.