Narrated Abu Huraira:
A man came to the Prophet. The Prophet (ﷺ) sent a messenger to his wives (to bring something for that man to eat) but they said that they had nothing except water. Then Allah's Messenger (ﷺ) said, "Who will take this (person) or entertain him as a guest?" An Ansar man said, "I." So he took him to his wife and said to her, "Entertain generously the guest of Allah's Messenger (ﷺ) " She said, "We have got nothing except the meals of my children." He said, "Prepare your meal, light your lamp and let your children sleep if they ask for supper." So she prepared her meal, lighted her lamp and made her children sleep, and then stood up pretending to mend her lamp, but she put it off. Then both of them pretended to be eating, but they really went to bed hungry. In the morning the Ansari went to Allah's Messenger (ﷺ) who said, "Tonight Allah laughed or wondered at your action." Then Allah revealed: "But give them (emigrants) preference over themselves even though they were in need of that And whosoever is saved from the covetousness Such are they who will be successful." (59.9)
Narrated Abu Huraira:
A man came to Allah's Messenger (ﷺ) and said, "O Allah's Messenger! I am suffering from fatigue and hunger." The Prophet (ﷺ) sent (somebody) to his wives (to get something), but the messenger found nothing with them. Then Allah's Messenger (ﷺ) said (to his companions). "Isn't there anybody who can entertain this man tonight so that Allah may be merciful to him?" An Ansari man got up and said, "I (will, entertain him), O Allah's Messenger!" So he went to his wife and said to her, "This is the guest of Allah's Messenger, so do not keep anything away from him." She said. "By Allah, I have nothing but the children's food." He said, "When the children ask for their dinner, put them to bed and put out the light; we shall not take our meals tonight," She did so. In the morning the Ansari man went to Allah's Messenger (ﷺ) who said, "Allah was pleased with (or He bestowed His Mercy) on so-and-so and his wife (because of their good deed)." Then Allah revealed: 'But give them preference over themselves even though they were in need of that.' (59.9)
Abu Huraira reported that a guest spent the night with a person from the Ansar who had nothing with him but food (sufficient) for his own self and his children. He said to his wife: (Lull) the children to sleep, and put out the lamp, and serve the guest with what you have with you. It was on this occasion that this verse was revealed:" Those who prefer the needy to their own selves in spite of the fact that they are themselves in pressing need" (Lix. 9).