For many centuries the Protoevangelium of James was an enormously popular and influential apocryphal gospel. Written in the latter half of the second century, purportedly by Jesus’ brother James, it tells the story of the birth of Mary and, later, of Jesus. It is charming and moving and in the best gospel tradition.
In this infancy narrative, Mary is the daughter of a wealthy, but long-childless couple, Joachim and Anna, who vow to give their unborn child to the Temple in gratitude. (The story appears to be patterned after the story of Elkanah and Hannah and their son Samuel in 1 Samuel 1–2.) From the age of three, Mary lives as a ward of the Temple (like Samuel). In the Temple she is fed by an angel. When she is grown, the high priest Zacharias is called upon to find a husband for her by assembling elderly widowers and having them draw lots. One of them is Joseph. Each of the widowers is given a rod. A dove comes out of Joseph’s rod and flies onto his head—a sign from God that he is the man. At first Joseph refuses, fearful that he will be a laughing-stock when she does not conceive. It will be seen as his fault: He is an old man and she is a young virgin. He needn’t have been worried, however. She becomes pregnant without Joseph’s intervention.
When Joseph comes home one day and finds her six months pregnant, he accuses her of infidelity. She weeps bitterly, proclaiming her innocence.