The work is an extract from the work The Life of Abraham. The earliest Syriac manuscript to contain it (fifth or sixth century) leaves the authorship anonymous.
The Life of Saint Mary the Harlot is later attributed to Ephraem, deacon of Edessa and was likely written towards the end of his life, though there have been claims against Ephrem's authorship. Certain parallels have been noticed between Ephraem and Abraham, the uncle of St. Mary, notably that both were hermits who gave up their hermitage for work in the world only to return just before their deaths. The character of Abraham may be a semi-autobiographical representation of Ephraem, or Ephraem was motivated by their personal similarities to record the story.
Ephraem writes that he is recounting the story in response to the unanimous request of his brethren, though this practice of claiming that one has been compelled to write is a common convention among ascetic authors as an expression of humility.
The translator of the text from Syriac into Greek and Latin is unknown.
The prologue, in which the author recounts this story to serve as a lesson in "compunction and humility" for those in their old age.
Abraham the hermit had a brother who died, leaving behind a seven-year-old daughter. The orphan, Mary, was brought by her father's friends to live with Abraham. He housed her in the outer room of the cell, while he lived in the inner room. Through a small window between the two rooms, Abraham taught her the psalter and the ascetic disciplines. Mary became great in spiritual virtue until she was an ascetic in her own right.
Mary's father had left her a large sum of money. Abraham, not wishing that she should be ensnared by the affairs of the world, represented by her inheritance, had the money given to the poor. She lived with him for twenty years.
A monk, who is called "a monk in profession only," came to visit Abraham, as was his habit. When he saw Mary, he lusted after her. He whispered things to her through the window, trying to tempt her. Finally, after a year had passed she came out to him, and they had sex.
Mary regretted the act immediately. She enters into a soliloquy about her sin, at one point making a veiled allusion to the supposed author by name, wishing she had been true to his writings. Finally, she concluded, "I am a sinner full of sordid uncleanness - how shall I even try to speak with my holy uncle? If I even dared to attempt it, wouldn't a blast of fire burst from him to burn me to ashes?" She therefore left her uncle for a foreign land.
Abraham did not notice that Mary had gone. Instead, the truth of what had happened was revealed to him in a series of two dreams. In the first dream, an enormous dragon approached his cell. Finding a dove there, the dragon swallowed it whole. Abraham interpreted this dream to mean that some great heresy would befall the church, and he beseeched God to prevent it.
Two days later, he had a second dream in which the dragon returned with his gut split open. Abraham could see that the dove was still alive in the beast's stomach, so he reached in and pulled it out. Only then did he understand that the dreams were about Mary's plight, with the dragon representing the devil, the dove representing Mary, and the two days between the dreams represents the two years that Abraham waited before pursuing his niece.
After two years, Abraham discovered Mary's location and sent a friend to give him a report on what she was doing. When he discovered the shameful life she was leading, he disguised himself as a soldier with a borrowed horse and uniform, and rode out to find her.
The author breaks the narrative to draw an analogy between the patriarch Abraham who rode out to do war with kings in order to save Lot and the hermit Abraham who rode out to do war with Satan in order to save Mary.
Abraham arrived at the inn where Mary worked where he convinced the innkeeper to send Mary to him under the guise of an old soldier looking for companionship. Mary appeared, dressed as a prostitute, and does not recognize Abraham. Abraham has to restrain his tears so she does not recognize him and flee.
Mary proceeded to try and seduce Abraham, but when she smelled "the familiar scent of an abstinent body" she became very agitated. Abraham and the innkeeper both work to calm her down, until finally she sat and enjoyed supper with him. When they had eaten, Mary once again began to entice the monk, and Abraham consented to go up to Mary's room with her.
The author pauses the narrative to praise God at length for the strength of the monk in breaking his ascetic ways in order to save Mary.
Once they were alone and the door had been locked, Abraham revealed himself to her. Mary sat petrified through the night as Abraham wept, prayed, and pleaded with her to return with him. Finally, he convinced her to leave, and she returned with him doing penance the whole way.
When they returned to Abraham's house, Mary lived in the inner room, while Abraham occupied the outer room. Mary spent her days weeping and praying for forgiveness and salvation. People begin to be drawn to Mary because of her religious zeal.
The remainder of the narrative gives an account of the final years of both Abraham and Mary, with eulogies of both. Abraham lived ten years after they returned, and Mary five years longer than he. Of Abraham, it was said that he remained constant in all virtue and "lived each day as if it was his last." Mary became famous not only for her piety but particularly for her mourning.
The author concludes the story by drawing an unfavorable comparison between himself and Abraham and Mary, disliking his own lack of total faith toward God. He begins by declaring "O what a wretch am I" and concludes "I mourn for the days of my negligence, for I have not any excuse to offer."
At the end of the hagiography is appended a prayer of St. Ephraem, which has theological implications in its fourth-century context:
Have mercy upon me, Thou that alone are without sin, and save me, who alone art pitiful and kind: for beside Thee, the Father most blessed, and Thine only begotten Son who was made flesh for us, and the Holy Ghost who giveth life to all things, I know no other, and believe in no other. And now be mindful of me, Lover of men, and lead me out of the prison-house of my sins, for both are in Thy hand, O Lord, the time that Thou shalt bid me go out from it elsewhere. Remember me that am without defence, and save me a sinner: and may Thy grace, that was in this world my aid, my refuge, and my glory, gather me under its wings in that great and terrible day. For Thou knowest, Thou who dost try the hearts and reins, that I did shun much of evil and the byways of same, the vanity of the impertinent and the defence of heresy. And this not of myself, but of Thy grace wherewith my mind was lit. Wherefore, holy Lord, I beseech Thee, bring me into Thy kingdom, and deign to bless me with all that have found grace before Thee, for with Thee is magnificence, adoration, and honour, Father, Son, and Holy Ghost.
Much of the content of the prayer appears to be targeted at the Arian heresy, against which Ephraem was a combatant.