Sayyiduna Ubayd bin Khalid (may Allah be pleased with him) says that the Messenger of Allah (peace and blessings be upon him) established brotherhood (mu'akhah) between two men. One of them was killed and the other remained. Then he too died, and the Companions (may Allah be pleased with them) offered his funeral prayer. He (peace and blessings be upon him) said: "What did you say about him?" They said: We prayed to Allah that Allah Almighty forgive him, have mercy on him, and join him with his brother. Then the Messenger of Allah (peace and blessings be upon him) said: "Then where are his prayers after the other's? Where are his deeds after the other's?" The narrator said: I think he (peace and blessings be upon him) also said: "Where are his fasts after the other's? By the One in whose hand is my soul, the distance between the two of them is like that between the heavens and the earth."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6529