Genesis Chapter 1, Verse 2
From BibleWiki
2: And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
2: And the earth was void and empty, and darkness was upon the face of
the deep; and the spirit of God moved over the waters.
2: But the earth was unsightly and unfurnished, and darkness was over the deep, and the Spirit of God moved over the water.
God gave the earth form on the first three days and filled its corresponding void on the following three days.
Day 1: Light / Dark - Day 4: Sun / Moon and Stars
Day 2: Sky / Sea - Day 5: Birds / Fish
Day 3: Land - Day 6: Animals and People
Because the earth was covered with water the sun must already be present, since water can only exist with heat. This would suggest that Genesis 1|1 was the creation on the stars and sun and moon (heavens) and earth. Light was not created in verse 3 it was only let onto the surface of the water. We know this because this is the point of reference for the text; the Spirit was on the water.
Some people from the old earth persective suggest that the Spirit's activity in this verse was for the creation of photosynthetic bacteria. This view does fit the fossil record and would be necessary for the build up of biomatter needed by following organisms. A long time would be need for this to happen if God introduced this biomatter using self replication as he did with the rest of life. i.e. 'After its kind' as described in Genesis 1|11-12 in relation to plants Genesis 1|21-22 in relation to creatures.

