عَنْ أُمِّ سَلَمَةَ زَوْجِ النَّبِيِّ رَضِيَ اللَّهُ عَنْهَا قَالَتْ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ يَقُولُ: ((مَا مِنْ عَبْدٍ تُصِيبُهُ مُصَيبَةٌ فَيَقُولُ إِنَّا لِلَّهِ وَإِنَّا إِلَيْهِ رَاجِعُونَ، اللَّهُمَّ أَجُرْنِي فِي مُصِيبَتِي (وَفِي رِوَايَةٍ: اللَّهُمَّ عِنْدَكَ أَحْتَسِبُ مُصِيبَتِي، فَأَجُرْنِي فِيهَا) وَاخْلُفْ لِي خَيْرًا مِنْهَا إِلَّا أَجَرَهُ اللَّهُ فِي مُصِيبَتِهِ وَخَلَفَ لَهُ خَيْرًا مِنْهَا))، قَالَتْ: فَلَمَّا تُوُفِّيَ أَبُو سَلَمَةَ، قُلْتُ: مَنْ خَيْرٌ مِنْ أَبِي سَلَمَةَ صَاحِبِ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ، قَالَتْ: فَعَزَمَ اللَّهُ عَزَّ وَجَلَّ لِي، فَقُلْتُهَا: اللَّهُمَّ أَجُرْنِي فِي مُصِيبَتِي وَاخْلُفْ لِي خَيْرًا مِنْهَا، قَالَتْ: فَتَزَوَّجْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ
The wife of the Messenger, Sayyidah Umm Salamah (may Allah be pleased with her), says: I heard the Messenger of Allah (peace and blessings be upon him) say: Whoever is afflicted by a calamity and recites this supplication: "Inna lillahi wa inna ilayhi raji'un. Allahumma ajurni fi musibati wakhluf li khayran minha." (Surely we belong to Allah and to Him we shall return. O Allah! Grant me reward in my calamity and grant me a better substitute for it) (In another narration: "Allahumma 'indaka ahtasibu musibati, fa'jurni fiha": O Allah! I seek reward for my calamity with You, so grant me reward in it), then Allah Almighty grants him reward in his calamity and gives him a better substitute.
It happened that when my husband, Sayyiduna Abu Salamah (may Allah be pleased with him), passed away, I said: Who could be better than Abu Salamah, who was a companion of the Messenger of Allah (peace and blessings be upon him)? Nevertheless, Allah Almighty gave me strength and I continued to recite this supplication: "Allahumma ajurni fi musibati wakhluf li khayran minha." (O Allah! Grant me reward in this calamity and grant me a better substitute for it.) So (as a result of this), I married the Messenger of Allah (peace and blessings be upon him).
Brief Explanation
Benefits: … Instead of the words of this supplication, "Allahumma ‘indaka ahtasibu musibati, fa’jurni fiha," it is also correct to say these words: "Allahumma’jurni fi musibati." In most common books, the latter wording is written. This supplication is extremely blessed, and since all calamities come from Allah Ta’ala, one should continue to recite this supplication with patience.