The woman with the twelve stars on her head can't be understood in isolation, that is, if you only read the verses that deal with her, you can't know who this person is. It could be any woman, and in fact, some mormons interpret her to be a human woman who because of her great faith, will be elevated to this position. Another psuedo-Christian group, the Children of Abraham, interpret this to be the second coming of Christ, a precursor to the third coming when he will be birthed by this woman so he can defeat the dragon and protect his true church, which is a precursor to his fourth coming, when he will split the sky open with trumpets on judgment day. And one other group I know of, the Followers of the Way, believe that this woman is one of them and that what she is birthing into the world is the new order of man, that is, a race of human beings that are perfect and indivincible and impentatrable to temptation. They believe this woman will be known because she will be born with 12 star-shaped birthmarks on her head. So interpreting this as being Mary is just one more interpretation of verses taken out of context.
By the way, in the 1990's a group of mormons who believed the interpretation that this woman would be one of them believed they had the prophesy that they should make human sacrifices to bring the end times about so she could begin her reign (the wife of the pastor believed it was her and she delivered the prophesy). End result was the killing of an entire family, husband, wife and four or five children, in Kirtland, Ohio. All were tried for the murders and that's when the story of the belief and prophesy came out. That's the danger in interpreting this passage in isolation, it makes it seem like this lady is a human being who has been brought to a special purpose to birth this child, and not what it truly is, a picture of Israel birthing the savior and then being chased out of their land by the vicious attacks of a great dragon (Roman empire).
Revelation is written in a code-language, not a plain language. It is full symbolism and it is very dangerous to interpret this woman as being a real person, because she is a symbol, not an actual person.
I found this in one of my mom's books (as you know I just moved back into my childhood home and am finding a lot of my mom's catholic things. It's from an evening course she took on Revelation at our local Catholic high school:
Who is the woman? That she is clothed with the sun, with the moon under her feet, and on her head a crown of twelve stars suggests she is the heavenly representative for something--what? Twelve connotes a connection to the twelve tribes of Israel. Is this woman then the heavenly Israel? Note, she is pregnant and about to bear a child (4) and that the dragon stands before her ready to devour the child. The woman gives birth to the child, "a son, a male child, who is to rule all the nations with a rod of iron... is snatched away and taken to God and his throne" (5). The woman flees into the wilderness and, like the Hebrew in Egypt, is rescued when she is given the two wings of an eagle and the river spewed from the mouth of the dragon is dried up by the earth: Exodus 19.4 "You have seen what I did to the Egyptians, and how I bore you on eagles' wings and brought you to myself." That the child is to rule nations with a rod of iron suggests the Davidic Messiah. For John, Christianity was born out of the Hebrew tradition and its culmination in Christ, who is to be "snatched up into heaven," or resurrected.
An alternate interpretation is:
This sign in heaven announces a new section. This should be connected to the opening of God's temple in heaven in the previous verse, Rev 11:19. The 'woman clothed with the sun, with the moon under her feet and a crown of twelve stars on her head' is a clear reference to Joseph's dream (Gen 37:9) and therefore the woman represents the twelve tribes of Israel. Joseph's dream depicts the sun and moon and eleven stars bowing down to him, this is realised when he became the second to Pharaoh and his brothers bowed down to him (Gen 43:26-29). The woman is the elect and in particular here she is the OT elect, who gives birth to the Christ (v5) and later she gives birth to the NT elect (v17). John sees a continuum between the OT and NT elect (see 21:12-14). Wilson says 'In scripture no sharp dividing line is drawn between the true Israel and the new Israel, because the people of the promise are one people, whether they lived before or after the coming of Christ'. But here she represents the OT elect, one of the few references in Revelation to the OT elect alone. Compare the heavenly glory of this woman, who represents the elect (the Bride Eph 5:22), with the earthly glitter of the harlot who represents the world, Rev 17:4. This woman stands in contrast to the harlot and also to the Queen of heaven.
Apparently even Catholicism doesn't necessarily teach that this woman is Mary.
I just found this:
The linkage of Mary to the woman of Revelation 12 first came from St. Epiphanius (d. 403), who warned Christians said, ""Let Mary be held in honour. Let the Father, Son, and Holy Ghost be adored, but let no one adore Mary," but believed that there was some mysterious dispensation with regard to her death implied in the words of Revelations 12:14: "And there were given to the woman two wings of a great eagle that she might fly into the desert unto her place." He indicated that this passage may have been fulfilled in the ascension of Mary. But his interpretation was dismissed until the middle ages when several apparitions of Mary appeared to people in distress and her appearance had a halo of stars around her head.
So there it seems you have it. Apparitions of Mary appeared to some sailors and travellers to have a halo of stars around her head and that's when the link was formulated between Mary and the woman of Revelation 12.