Sayyiduna Anas bin Malik (may Allah be pleased with him) narrates: When the Prophet (peace and blessings be upon him) found any man among his companions absent for three days, he would ask about him. If he was away, he would supplicate for him; if he was present (in the city), he would go to meet him; and if he was ill, he would go to visit him. Once he found a man from the Ansar absent on the third day, so he asked about him. It was said: "O Messenger of Allah! We found him like qar' (a barren place where no vegetation grows); whatever goes into his mouth comes out from his private part (as excrement)." The Prophet (peace and blessings be upon him) said to some of his companions: "Visit your brother." The narrator says: We set out with the Prophet (peace and blessings be upon him) to visit that man, and among the people were Sayyiduna Abu Bakr (may Allah be pleased with him) and Sayyiduna Umar (may Allah be pleased with him). When we reached him, he was in the same condition that had been described to us. The Prophet (peace and blessings be upon him) asked: "How are you?" He said: "Whatever goes into my head (that is, my mouth) comes out from my private part." The Prophet (peace and blessings be upon him) asked: "What is the reason for this?" He said: "O Messenger of Allah! Once I passed by you while you were leading the Maghrib prayer. I prayed behind you, and you recited Surah al-Qari'ah in it. So I made this supplication: 'O Allah! For whatever sin of mine I am to be punished in the Hereafter, give me the punishment for that sin in this world.' So I have had to face the condition that you are seeing." The Prophet (peace and blessings be upon him) said: "You said a very wrong thing. Could you not have asked Allah Almighty to grant you good in this world and good in the Hereafter as well, and to save you from the punishment of Hell?" The narrator says: The Prophet (peace and blessings be upon him) instructed that man, so the man made this supplication, and then the Prophet (peace and blessings be upon him) also supplicated for him. The narrator says: Then that man stood up as though he had been released from ropes. The narrator says: When we came out from there, Sayyiduna Umar (may Allah be pleased with him) said: "O Messenger of Allah! A little while ago you encouraged us to visit the sick, so what reward will we receive for it?" The Prophet (peace and blessings be upon him) said: "When a Muslim man goes out of his house to visit his Muslim brother, he remains immersed in mercy up to the place where the lower garment is tied, and when he sits with the sick person, mercy covers him. The sick person is in the shade of the Throne, and the visitor is in the shade of His holiness. Allah Almighty says to the angels: 'Look how much reward the visitors hoped for with the sick person.' The angel says: 'My Lord, for as long as it takes to milk a she-camel,' even if he hoped for reward only for as long as it takes to milk a she-camel. Then Allah Almighty says to the angels: 'Record for My visiting servant the reward of the worship of a thousand years, the voluntary prayers of its nights and the voluntary fasts of its days, and tell him that I will not record a single sin against him.'" The Prophet (peace and blessings be upon him) said: "Allah Almighty says to the angels: 'Look for how long they hoped for reward.'" The Prophet (peace and blessings be upon him) said: "The angels say: 'For one hour,' even if they hoped for reward for one hour. Then Allah Almighty says: 'Record for him the reward of an age,' and an age consists of ten thousand years. If that person dies before that, he will enter Paradise, and if he lives, not a single sin will be recorded against him. If it is morning (that is, when that person went to visit), seventy thousand angels keep invoking mercy for that person until evening, and that person keeps gathering the fruits of Paradise; and if it is evening (when he goes to visit), seventy thousand angels keep invoking mercy for him until morning, and that person keeps gathering the fruits of Paradise (during that time)."
Abu Ya'la recorded it. Its chain contains Abbad bin Kathir; he was a righteous man, but da'if al-hadith (weak in hadith), and he was deemed matruk (abandoned) because of his heedlessness.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الجنائز / 3761