The second exception is beneficial knowledge, and of the three it is the widest in scope, the most comprehensive, and the most rewarding. It is for a person to leave behind knowledge from which Muslims continue to benefit, whether that knowledge is passed on orally or preserved in writing. Authoring books, teaching people, and the ongoing circulation of that information—all of this ensures that the teacher’s reward flows uninterrupted, for people go on drawing benefit from the knowledge he has bequeathed.
The third is a righteous child who prays for him. The word “child” includes both males and females—a son or a daughter—and extends to your children, your grandchildren through your sons and daughters, and their descendants after them. A righteous offspring who supplicates for a person after his death likewise brings him reward.
Observe how the Messenger of Allah (peace and blessings be upon him) said, “a righteous child who prays for him.” He did not say, “a righteous child who performs the ritual prayer for him, or recites the Qur’an for him, or gives charity on his behalf, or fasts on his behalf.” He mentioned none of those, even though they are all righteous deeds; instead he singled out, “a righteous child who prays for him.” This indicates that making supplication (duʿāʾ) for one’s father, mother, grandfather, or grandmother is better than giving charity, performing prayer, or fasting on their behalf. The Prophet (peace and blessings be upon him) would never direct his community to anything but the very best course of action; every prophet whom Allah sent guided his nation to the finest good he knew for them. Had the Messenger of Allah (peace and blessings be upon him) known that giving charity for one’s parents was superior to supplication, he would have mentioned charity instead. Yet, while speaking about deeds, he set aside charity, fasting, prayer, and Qur’an recitation and focused exclusively on supplication; therefore we know with absolute certainty that supplication is superior. If someone were to ask, “Which is better: that I give charity for my father, or that I pray for him?” we would reply, “Supplication is better, because the Messenger of Allah—”