Alsiraj Official Website
Sayings (Hadiths) of Prophet Muhammad
About the words one should say to deceased person
1-Narrated Osama ibn Zayed:the daughter of the Prophet sent (a courier) to the Prophet requesting him to come as her child was dying, but the Prophet returned the envoy and told him to convey his greeting to her. He said:"whatever Allah takes is for Him and whatever He gives is for Him, and everything with Him has a limited fixed term (in this world) and so she should be patient and hope for Allah’s reward." She again sent for him, swearing that he should come. The Prophet got up and so did Saad ibn Obada, Moaz ibn Jabal, Obayy ibn Kaab, Zayed ibn Thabit, and some other men. The child was brought to Allah’s Messenger while his breath disturbed(the sub-narrator thinks that Osamah added:he was gasping as if it was a leather water skin ). At that the eyes of the Prophet started shedding tears. Saad said: o Allah’s Messenger what is it? He replied:"it is a mercy which Allah has lodged in the heart of His slaves, and Allah is Merciful only to those of His servants who are merciful to others. "
(Bukhari)