"A Janazah was brought to the Prophet and they said: " O Prophet of Allah, pray for him.' He said: "Did he leave any debt behind?' They said: "Yes.' He said 'Did he leave anything?' They said: No. He said; 'Pray fro your companion.' A man among the Ansar who was called Abu Qatadah said: 'Pray for him and I will pay off his debt.' So he prayed for him."
Sunan an-Nasa'i Book 21, Hadith 144