The book of Revelation teems with signs and symbols. It was written as a kind of insiders' book. The use of symbols made its meaning obscure to enemies and persecutors of the Church while those for whom the book was intended got the message loud and clear.
Chapter 12 in Revelation, containing the verse about the 12 stars, reflects the struggle between Satan and God's people in both the Old and New Testaments. The woman clothed with the sun represents—or is seen to represent&mdashboth the People of God pictured by the prophets (an ideal sign), and the Church of the New Testament. The dragon who seeks to destroy her is Satan, the devil.
In writing, John may have had in mind the dream of Joseph in Genesis 37:9-10 when he saw the sun, moon, and 11 stars (the other brothers or tribes) bowing down to him. And John almost certainly was recalling the woman in Genesis 3 whose offspring would crush the head of the serpent.
Over the centuries some commentators have believed that John also had in mind Mary, the mother of Jesus and God's people, when he wrote this passage in Revelation. Whatever John's immediate intention, the words are repeatedly applied to Mary in Christian writings and interpretations of Revelation.
On the first level, with the woman as the image of an ideal Israel and the Church, the sun can be seen to represent Christ or the light of Christ. The Church is clothed in the light of Christ; in and through the Church shines the light of Christ. The moon represents the presence of heavenly glory. The stars represent the 12 tribes of Israel and the Twelve Apostles.
The symbols have much the same significance when the woman in Revelation is seen as Mary or the passage is applied to her as the queen assumed into heaven, the queen of patriarchs, queen of prophets, queen of apostles and queen of all saints whose praises we sing in the litany of the Blessed Virgin.