It is narrated from Sayyidah Umm Salamah (may Allah be pleased with her) that she heard the Messenger of Allah (peace and blessings be upon him) say: "There is no servant who is struck by a calamity and says: 'Inna lillahi wa inna ilayhi raji'un, Allahumma ajurni fi musibati wakhluf li khayran minha' (We belong to Allah and to Him we return; O Allah, reward me in my calamity and give me something better than it in exchange), except that Allah Almighty rewards him in his calamity and gives him something better than it in exchange." She said: Then, when Sayyiduna Abu Salamah (may Allah be pleased with him) died, I said: Who could be better than Abu Salamah, the Companion of the Messenger of Allah (peace and blessings be upon him)? Then Allah Almighty enabled me to say it, so I recited this supplication, and later I was married to the Messenger of Allah (peace and blessings be upon him).
Hadith Referenceالمعجم الكبير للطبراني / مسند النساء / 19996