Sahih Muslim Book 004, Hadith Number 2000.
Chapter : What is to be said at the time of calamity.
Umm Salama, the wife of the Apostle of Allah (may peace be upon him), reported Allah's Messenger (may peace be upon him) as saying: If any servant (of Allah) who suffers a calamity says: "We belong to Allah and to Him shall we return; O Allah, reward me for my affliction and give me something better than it in exchange for it,"' Allah will give him reward for affliction, and would give him something better than it in exchange. She (Umm Salama) said: When Abu Salama died. I uttered (these very words) as I was commanded (to do) by the Messenger of Allah (may peace be upon him). So Allah gave me better in exchange than him. i.e. (I was taken as the wife of) the Messenger of Allah (may peace be upon him).