Hadith 6:577
Muhammad ibn Fudayl narrated to us, from al-Ala’ ibn al-Musayyab, from his father, from Ali, that when he would pray over a deceased person, he would begin with the praise of Allah and send blessings upon the Prophet, may Allah bless him and grant him peace. Then he would say: "O Allah, forgive our living and our dead, unite our hearts, rectify the matters between us, and place our hearts upon the hearts of the best among us."
حدثنا محمد بن فضيل عن العلاء بن المسيب عن أبيه عن علي أنه كان إذا صلى على ميت يبدأ بحمد الله ويصلي على النبي صلى الله عليه وسلم ثم يقول اللهم اغفر لاحيائنا وأمواتنا وألف بين قلوبنا وأصلح ذات بيننا واجعل قلوبنا على قلوب خيارنا