أَخْبَرَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، عَنْ يَحْيَى، عَنِ الأَعْمَشِ، قَالَ حَدَّثَنِي شَقِيقٌ، عَنْ أُمِّ سَلَمَةَ، قَالَتْ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏"‏ إِذَا حَضَرْتُمُ الْمَرِيضَ فَقُولُوا خَيْرًا فَإِنَّ الْمَلاَئِكَةَ يُؤَمِّنُونَ عَلَى مَا تَقُولُونَ ‏"‏ ‏.‏ فَلَمَّا مَاتَ أَبُو سَلَمَةَ قُلْتُ يَا رَسُولَ اللَّهِ كَيْفَ أَقُولُ قَالَ ‏"‏ قُولِي اللَّهُمَّ اغْفِرْ لَنَا وَلَهُ وَأَعْقِبْنِي مِنْهُ عُقْبَى حَسَنَةً ‏"‏ ‏.‏ فَأَعْقَبَنِي اللَّهُ عَزَّ وَجَلَّ مِنْهُ مُحَمَّدًا صلى الله عليه وسلم ‏.‏

It was narrated that Umm Salamah said: "I heard the Messenger of Allah say: 'When you see the dead, say something good, for the angels say Amin to whatever you say; When Abu Salamah died, I said: 'O Messenger of Allah, what should I say?' He said: 'Say" Allahummaghfirlanaa wa lahu wa a 'qibni minhu 'uqbai hasanah (O Allah, forgive us and him, and compensate me well for this loss.)"' Then Allah, the Mighty and Sublime, compensated me with Muhammad." Translation Not Available

Book Ref: Sunan An Nisai Book 21 Hadith 1825
Web Ref:  Sunan An Nisai Vol 3 Book 21 Hadith 1826