Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that when the Messenger of Allah (peace and blessings be upon him) offered a funeral prayer, he would recite this supplication: 'Allahummaghfir li-hayyina wa mayyitina, wa shahidina wa gha'ibina, wa saghirina wa kabirina, wa dhakarina wa unthana, Allahumma man ahyaytahu minna fa-ahyihi alal-Islam, wa man tawaffaytahu minna fa-tawaffahu alal-iman' (O Allah, forgive us: our living and our dead, our absent and our present, our young and our old, our male and our female. O Allah, whomever of us You keep alive, keep him upon Islam, and whomever You cause to die, cause him to die in a state of faith.)
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6971