Reference: al-Muntaqaa min Fataawa Shaykh Saalih al-Fowzaan – Volume 2, Page 163, Fatwa No.142
Question: My husband was martyred two years ago and prior to his martyrdom I used to perform the prayer for myself, however, after he was martyred I began to perform the prayer for myself and also on his behalf. And I [have continued upon] this state (way), so is this permissible for me to do or not?
Response: No-one should perform the prayer on behalf of another; It is upon you to supplicate for your husband and increase in supplication and seeking forgiveness for him and to give in charity on his behalf. This is because the prayer does not fall into that which can be performed on someone elses behalf as it is a physical action [specific to the one performing it]. And Allaah has legislated supplication for the deceased and the seeking of forgiveness for them and the giving in charity on their behalf [on the condition] if they were Muslims, and this is sufficient if Allaah accepts it.