It is narrated from Sayyiduna Anas (may Allah be pleased with him) that a man came to the Prophet (peace and blessings be upon him) and said: My father died without having performed Hajj; shall I perform Hajj on his behalf? He (peace and blessings be upon him) said: "Tell me, if your father had owed a debt and you had paid it, would it have been paid off?" He said: Yes. He (peace and blessings be upon him) said: "Then perform Hajj on behalf of your father."
Hadith Referenceالمعجم الكبير للطبراني / باب الألف / 744