In the Zohar (the holy text of the mystical faith Kabbalah), rabbis comment on the Bible and Torah account in Genesis of God creating the Earth. Genesis describes seven "days" (meaning simply "time periods") of creation, and the Zohar says that, in one sense, God created all angels on the first day when he made light, but in another sense, God created archangel Raphael on the second day, when He began forming the Earth by separating sky from water -- since God would appoint Raphael to heal the Earth after it became corrupted by sin.
Angels Emanating from Divine Light
God made angels as part of the light that He created to shine throughout the universe, and angelic light reflects the divine light of God Himself, the Zohar says in Genesis 23: "The first day of the creation is the synthesis of all the other days, for as there is really no separate fractional moment in time, they only formed part of the whole. It is written, 'God said let there be light' meaning angelic beings who are emanations from the light on high that shines forth on the world below and were created on the first day and took up their position on the right hand of the Holy One. 'And God saw the light that it was good.' The word 'ath' before good, refers to the luminous and non-luminous mirror, the one 'being the light by which the Beatific Vision is acquired by prophets, the other that which enlightens the mind of man for the perception of truth."
Later in Genesis 23, the Zohar continues: "The word 'ath' indicates that in the light that God called good, are comprehended and included all the angelic hosts that emanated from it and also when perfect harmony prevails amongst all orders of beings, will regain their pristine splendor."
The Zohar presents another perspective on angelic creation when it describes God's plans for archangel Raphael later in Genesis 23: "The fact is that the angel Raphael, who is appointed to heal the earth of its evil and affliction and the maladies of mankind, was created on the second day."
The second day was when God began forming the Earth that He knew would eventually need healing (after the Fall brought sin to Earth), so God anticipated the need for a healing archangel like Raphael because He knew what would happen to His perfect Earth when sin would corrupt it in the future.