The scholars agree that if an individual dies and has missed some prayers during his life, his guardian or heir is not to perform those prayers on his behalf. Similarly, if one does not have the ability to fast, no one is to fast for him while he is alive. There is a difference of opinion over the case of one who dies and has not made up some days of fasting although he had the ability to do so.
Most scholars, including Abu Hanifah, Malik, and the Shaf’iyyah, say that the guardian or heir is not to fast on such a person’s behalf, but is to feed one person a day for the missed days. The chosen opinion, however, among the Shaf’iyyah is that it is preferred for the guardian to fast on the deceased’s behalf, thus fulfilling his duty. There is therefore no need for him to feed anyone.
The meaning of guardian is near relative, whether it be an agnate or an heir or someone else. If a non-relative fasts for the deceased, it will only be valid if he got the permission of the guardian.
The proof for the preceding is what Ahmad, al-Bukhari, and Muslim recorded from ‘Aishah. The Messenger of Allah, upon whom be peace, said: “If one dies and has some fasts to make up, then his guardian’ should fast on his behalf.” Al-Bazzar added the words: “If he wishes to do so, while Ibn ‘Abbas related that a man came to the Prophet and said: “O Messenger of Allah, my mother died and a month’s fasting was due from her. Should I fast on her behalf?” The Prophet asked: “If your mother had a debt would you fulfil it for her?” He said, “Yes.” The Prophet observed: “A debt to Allah has more of a right to be fulfilled.” This is related by Ahmad, atTirmizhi, an-Nasa’i, Abu Dawud, and Ibn Majah.
An-Nawawi [one of the most knowledgeable of the Shaf’iyyah] says: “That statement is the most authentic one, and we follow it. This is the opinion that has been determined to be correct according to our companions in both hadith and fiqh.”