And those who believe and whose offsprings follow them in faith- to them shall We join their offspring, and We shall not decrease the reward of their deeds in anything. Every person is a pledge for that which he has earned. {1} (Tafsir Ath-Thawri 283)
Ibn Jarir and Ibn Abi Hatim recorded this statement from Sufyan Ath-Thawri from Ibn Abbas. {2} (At-Tabari 22:467)
Ibn Abi Hatim also recorded that Ibn Abbas commented on Allah's statement,
And those who believe and whose offsprings follow them in faith- to them shall We join their offspring.
saying, "They are the offspring of the believers who died on the faith. If the ranks of their parents are higher than their ranks, they will be joined with their parents. No part of the reward their parents received for their good deeds will be reduced for them."
Abdullah, son of Imam Ahmad, recorded that 'Ali said, "Khadijah asked the Prophet (alayhee salatul wasalaam) about two of her children who died during the time of Jahiliyyah, and the Messenger of Allah (alayhee salatul wasalaam) said; "They are both in the Fire" When he saw sadness on her face, he said "If you saw their dwelling place, you would hate them. She said, "O Allah Messenger! What about my children with you.' He said, "They are in Paradise." The Messenger of Allah (alayhee salatul wasalaam) said,
"Verily, the believers and their offspring will dwell in Paradise, while the idolators and their offspring will dwell in the Hell-fire.
The Prophet (alayhee salatul wasalaam) then recited the ayah,
And those who believe and whose offsprings follow them in faith...{1}***
*** Ahmad 1:135. This is a weak Hadith according to the majority of the scholars***
Certainly, it is Allah's grace and favor that He grants the children this blessing because of the good deeds of their parents. He also grants His favor to parents on account of their offspring invoking Allah for them. Imam Ahmad recorded that Abu Hurayrah, (radiallahu anhu), said that the Messenger of Allah (alayhee salatul wasalaam) said,
"Verily, Allah shall elevate the grade of a righteous servant in Paradise, who will ask, "O Lord! How did I earn this?' Allah will reply, "Through your son's invoking Me to forgive you." {1} (Ahmad 2:509)
This Hadith has an authentic chain of narration, but it was not recorded in the Sahih this way. However, there is a witnessing narratoin for it in Sahih Muslim, from the Hadith of Abu Hurayrah, who said that the Messenger of Allah (alayhee salatul wasalaam) said,
"When the Son of Adam dies, his record of deeds will cease except in three cases: an ongoing charity, knowledge that people are benefitting from and a righteous son who invokes Allah for him." {2} (Muslim 3:1255)