Sa’d b. Mihran narrated from Muhammad b. Sadaqa from Muhammad b. Sinan al-Zahiri from Yunus b. Zabyan from Muhammad b. Isma’il from Jabir b. Yazid al-Ju’fi, who said: A man from the Bani Umayya came to Abu Ja’far, peace be upon him. He was a believer from the family of Fir’awn, attached to the family uf Muhammad. He said: “O son of the Messenger of Allah, my bondmaid has entered her month [of childbirth] and I have no child, so pray to Allah to grant me a son.” He [Abu Ja’far] said: “Allah, grant him a healthy male child.” Then he said: “When she enters her month [of childbirth] write for her the sura al-Qadr (197), and protect her and what is in her belly with this invocation [written] with musk and saffron. Wash it out and make her drink its water and sprinkle her genitals [with it].
The invocation is this:
‘I seek protection for my newborn child in the Name of Allah, in the Name of Allah.
We stretched towards heaven, but we found it filled with terrible guards and meteors. We would sit there on seats to hear, but any listening now finds a meteor in wait for him (72:8-9).’
Then say: ‘In the Name of Allah, in the Name of Allah, I take refuge in Allah, the All-hearing, the All-knowing, from the accursed Satan, I and you and the house and those in it, and the dwelling and those in it. We, all of us, are in the refuge of Allah, and the protection of Allah, and the preserve of Allah, and the safekeeping of Allah, secure and safeguarded.’
“Then recite the two Suras of taking protection [al-Falaq (113) and al-Nas (114)], and begin with the sura al-Fatiha (1) and the sura al-Ikhlas (112). Then recite:
What, did you think that We created you only for sport, and that you would not be returned to Us? Then high exalted be God, the King, the True! There is no god but Allah, the Lord of the noble Throne. Whosoever calls upon another god with God, whereof he has no proof, his reckoning is with his Lord. Surely the unbelievers shall not prosper. And say: My Lord, forgive, and have mercy, for Thou art the best of the merciful (23:115-18). If We had sent this Qur'an down upon a mountain, thou wouldst have seen it humbled, split asunder out of the fear of God (59:21), to the end of the Sura.
“'Then say: ‘Banished are they who contend with Allah and His Messenger. I adjure you, O house and those in you, by the seven names and the seven angels who come and go between
the heavens and the earth, veiled from this woman and what is in her belly, every possession by a jinn and stealing, or touch, or shining apparition touched by man or jinn.’
When he has finished this statement and this invocation, he should say: ‘I mean by this statement and this invocation so-and-so, his wife and child, his dwelling, his house and his wife and child.’ Then let him name himself and his dwelling and his house and his wife and his child, and let him utter it and say:
‘The wife of so-and-so, son of so-and-so; and his son – so-and-so, son of so-and-so.’ It is wiser for him and better, and I guarantee that his wife and child will not be afflicted with trial, mental disorder (al-khabl), or madness, Allah, the Exalted, willing.”