It is narrated in the two Sahīh collections that Abū Hurayra—may Allah be pleased with him—said:
“A man came to the Prophet—may Allah bless him and grant him peace—and said, ‘I am in dire straits.’ He sent word to one of his wives, who replied, ‘By Him who sent you with the truth as a prophet (1), I have nothing but water.’ He then sent word to another, who gave the same reply, until they had all said the same thing: ‘No (2), by Him who sent you with the truth, I have nothing but water.’
“He said, ‘Who will host him tonight—may Allah have mercy on whoever does so?’ A man from the Ansār stood and said, ‘I will, O Messenger of Allah.’ He set off (3) with him for his home (4) and asked his wife, ‘Do you have anything?’ She replied, ‘Nothing except our children’s food.’ He said, ‘Keep them occupied with something. When our guest enters, extinguish the lamp and make him think that we are eating. Then, when he reaches down (5) to eat (6), go to the lamp and extinguish it (7).’
“He continued, ‘So they sat down [and the guest ate] (8).’ The next morning, he went to (9) the Messenger of Allah—may Allah bless him and grant him peace—who said, ‘Allah was indeed amazed at what the two of you did for your guest last night.’
“According to another narration, this verse was then revealed:
‘They give others preference over themselves, even though they themselves are in need.’”
[Surah al-Hashr: 9]) (10).