Valmiki Ramayana Aranya Kanda Sarga 68 Shloka 34
Original Shlokaयत्तत्प्रेतस्य मर्त्यस्य कथयन्ति द्विजातयः।।3.68.34।। तत्स्वर्गगमनं तस्य पित्र्यं रामो जजाप ह।
1 source checked for this shloka
तत् that, यत् whatever, द्विजातयः brahmins, प्रेतस्य for the dead, मर्त्यस्य for a mortal, स्वर्गगमनम् for ascending to heaven, कथयन्ति they utter, तत् all that, पित्र्यम् pertaining to father, तस्य that, जजाप muttered.
Rama muttered the mantras recommended by brahmins for dead mortals as one would do for his father, to help him ascend to heaven.