Light was created on the first day, but the Sun was created on the fourth. And Genesis presents the Universe's primordial state as being just a watery mass, so water existed before both.
Fun fact: Proverbs 8 identifies Wisdom as the first of God's works, hence the Judeo-Christian tradition of identifying Wisdom with light. http://www.esvbible.org/Proverbs+8/
The New Testament also identifies Jesus as both Wisdom and Light, despite Wisdom being female in Proverbs.