Sayyidina Ibn ‘Abbaas (may Allah be please with him) says, our Master the Holy Prophet (Allah’s blessings and peace be upon him) said,
“A dead person in the grave is like a drowning person expecting (help in the form of) supplications (du‘aa) from his father, or mother, or son, or friend. When it (du‘aa) reaches him it will be more beloved to him than the world and what it contains. Allah transmits the du‘aas of the people of the world (in the form of rewards) that is equivalent of mountains.
The gift of the living to the dead is to seek forgiveness (maghfirah) for them.”
– Bayhaqii in Shi‘abul Imaan.
Sayyidina Abu Hurayrah (may Allah be pleased with him) says, our Master the Holy Prophet (Allah’s blessings and peace be upon him) said,
“When a human passes away, his deeds come to an end, except from three things:
1. Charity that continues (sadaqah jaariyah) (like a waqf etc.); or
2. Knowldge (‘ilm) from which benefit continues to be derived (like teaching, writing books etc.); or
3. A pious son who makes supplication (du‘aa) for him.”
– Bukhaari, Muslim, quoted in Sharhus Sudur.