Shaykh Abdul Azeez ibn Baaz rahimahullaah in his Majmoo` Fataawaa vol. 13 pg. 250 was asked the following question:
Q: Is it allowed to gift some good actions to a deceased person?
A: It is allowed to gift the actions that have been reported by the pure legislation; such as giving in charity, making supplication, repaying a debt, performance of Hajj and Umrah (major and minor pilgrimages) – as long as the person that is having the Hajj made for them has passed away, or is unable to do so; due to old age, or due to an illness that he does not think he will recover from. In the same way Umrah can be made for such a person.
This is because of the many narrations from the Prophet sallAllaahu `alaihi wa sallam indicating such, and it has been mentioned in the Noble Book that which indicates making supplication for the Muslims, whether they are dead or alive, that is something that is legislated, just as occurs in the saying of Allaah the Most High:
وَالَّذِينَ جَاءُوا مِن بَعْدِهِمْ يَقُولُونَ رَبَّنَا اغْفِرْ لَنَا وَلِإِخْوَانِنَا الَّذِينَ سَبَقُونَا بِالْإِيمَانِ وَلَا تَجْعَلْ فِي قُلُوبِنَا غِلًّا لِّلَّذِينَ آمَنُوا رَبَّنَا إِنَّكَ رَءُوفٌ رَّحِيمٌ
And those who came after them say: “Our Lord! Forgive us and our brethren who have preceded us in Faith, and put not into our hearts any hatred against those who have believed. Our Lord! You are indeed full of kindness, Most Merciful. [59:10]
And like his saying (sallAllaahu `alaihi wa sallam): “When the son of Aadam passes away all of his actions are cut off, except for three: A continuous charity, or knowledge which people derive benefit from or a pious child who makes supplication for him.”
And it has been established from him sallAllaahu `alaihi wa sallam that a man said to him: O Messenger of Allaah! “My mother died suddenly and did not leave a bequest, and I think that if she had lived she would have given alms. So, if I give alms now on her behalf, will she get the reward?” The Prophet said “Yes”. Agreed upon (Bukhaaree and Muslim)
And it has also been authentically reported from the Prophet sallAllaahu `alaihi wa sallam that a man said: “O Messenger of Allaah! Is there anything remaining from righteousness for my parents that I may do after they have passed away? He said: “Yes, you can invoke blessings on them, seek forgiveness for them, carry out their final instructions after their death, honour their friends, and join ties of relationship which are dependent on them.” (Ahmad no. 15629 and Abu Dawud no 5142)
And Allaah is the Granter of success.