Nafi' (may Allah have mercy on him) says that when Sayyiduna Ibn Umar (may Allah be pleased with them both) was asked about a man who died while owing fasts of Ramadan or a vow and the like, he would say: "No one fasts on behalf of anyone else, but give charity on his behalf from his wealth for the fasting: one poor person for each day."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصيام / 8215