Al-Kāfi - Volume 6 > Prayer and Appeal before Allah for a Son
Hadith #2

مُحَمَّدُ بْنُ يَحْيَى عَنْ أَحْمَدَ بْنِ مُحَمَّدٍ عَنْ عَلِيِّ بْنِ الْحَكَمِ عَنْ سَيْفِ بْنِ عَمِيرَةَ عَنْ أَبِي بَكْرٍ الْحَضْرَمِيِّ عَنِ الْحَارِثِ النَّصْرِيِّ قَالَ قُلْتُ لِأَبِي عَبْدِ اللَّهِ ( عليه السلام ) إِنِّي مِنْ أَهْلِ بَيْتٍ قَدِ انْقَرَضُوا وَ لَيْسَ لِي وَلَدٌ قَالَ ادْعُ وَ أَنْتَ سَاجِدٌ رَبِّ هَبْ لِي مِنْ لَدُنْكَ وَلِيّاً يَرِثُنِي رَبِّ هَبْ لِي مِنْ لَدُنْكَ ذُرِّيَّةً طَيِّبَةً إِنَّكَ سَمِيعُ الدُّعَاءِ رَبِّ لَا تَذَرْنِي فَرْداً وَ أَنْتَ خَيْرُ الْوَارِثِينَ قَالَ فَفَعَلْتُ فَوُلِدَ لِي عَلِيٌّ وَ الْحُسَيْنُ .

2. Muhammad ibn Yahya has narrated from Ahmad ibn Muhammad from Ali ibn af-Hakam from Sayf ibn ‘Amirah from abu Bakr al- Hadramiy from af-Harith af-Nasriy who has said the following: “I once said to abu ‘Abd Allah, ‘Alayhi al-Salam, that I belong to a family that is extinct and I do not have any children. He (the Imam) said, ‘Pray when you are in Sajdah (prostration), ‘[My Lord, grant me from Your dominion an heir who will inherit me]. O Lord, grant me fine offspring from Your dominion; You hear the prayers. O Lord, do not leave me alone and You are the best heir.’ He (the narrator) has said that I followed the instruction, then Ali and al-Husayn (my sons) were born.’”