He was asked:
Ramadan came upon a man during his illness, and he was unable to fast. He died owing the fasts of Ramadan, as well as the prayers missed during his illness, while both his parents were still alive. Are these obligations discharged if his parents fast and pray on his behalf, whether or not he left instructions for this?
He replied:
If his illness persisted and he was unable to make up the missed fasts, his heirs are required only to provide food on his behalf. As for the obligatory prayers, no one may perform them on another’s behalf. However, if either parent performs voluntary prayers on behalf of the deceased and dedicates their reward to him, or observes voluntary fasts on his behalf and dedicates their reward to him, that benefits him. Allah knows best.