From Aboo Hurayrah radi Allaahu ‘anhu who said:
While we were sitting with the Prophet sall Allaahu ‘alaihi wa sallam a man came to him and said:
O Messenger of Allaah, I am destroyed!
He said, “What has destroyed you?”
He said, “I had sexual intercourse with my wife whilst I was fasting.”
(And in one version):
“I had sexual intercourse with my wife in the (daytime) in Ramadaan.”
So the Prophet sall Allaahu ‘alaihi wa sallam said, “Do you find that you have (the price) of a slave, so that you could set him free?”
He said, “No.”
He said, “Are you able to fast two consecutive months?”
He said, “No.”
He said, “Do you find (enough) to feed sixty miskeen people (those who do not have enough for themselves nor their family)?”
He said, “No.”
So the Prophet sall Allaahu ‘alaihi wa sallam remained for a time – and while we were like that, he was brought a basket containing dates.
He said, “Where is the person who was asking?”
He said, “It was me.”
He said, “Take this and give it in charity.”
So he said, “To someone who is greater in need than me, O Messenger of Allaah? For, by Allaah, there is not between the two lava plains (of al Madeenah) a household that is more in need than my household!”
So the Messenger of Allaah sall Allaahu ‘alaihi wa sallam laughed until his canine teeth became visible, then he said, “Feed it to your family.”
==========
The Shaykh Muhammad ibn Saalih al ‘Uthaymeen rahimahullaah commented:
Aboo Hurayrah radi Allaahu ‘anhu narrates that they were sitting with the Prophet sall Allaahu ‘alaihi wa sallam, as was their habit of sitting with him in order to learn from him and be companionable with him.
So whilst they were like this, a man came, who recognised that he was destroyed due to the sin he had committed, wanting redemption from that.
So he said, “O Messenger of Allaah, I am destroyed.” And then he sall Allaahu ‘alaihi wa sallam asked him about the reason for (thinking) that. So the man replied that he had had sexual intercourse with his wife during the daytime in Ramadaan whilst fasting.
So the Prophet sall Allaahu ‘alaihi wa sallam did not deal with him harshly because he (the man) had come in repentance, seeking redemption for that which he had fallen into.
So the Prophet sall Allaahu ‘alaihi wa sallam guided him to that which contained redemption, asking him whether he had the (funds) to free a slave, so that it would be an expiation for him. The man replied in the negative.
So he asked him whether he was able to fast two consecutive months, with no day off from fasting coming into them.
He replied in the negative.
So he moved him onto the third and last option, asking him whether he was able to feed sixty miskeen people. He replied in the negative as well.
Then the Prophet sall Allaahu ‘alaihi wa sallam remained until a man from the Ansaar brought a basket containing dates. So the Prophet sall Allaahu ‘alaihi wa sallam said to the man who had asked, ““Take this and give it in charity.” Meaning – as an expiation for that which was upon him.
However due to the state of need which this man was in and his knowledge of the generosity of the Prophet sall Allaahu ‘alaihi wa sallam and his love of making ease for his nation, he entertained some hope; so he (the man) said, “To someone who is more in need than me?” And he swore an oath that there was no household between the two lava plains of al Madeenah who was more in need than his household.
So the Prophet sall Allaahu ‘alaihi wa sallam laughed, marvelling at the situation of this man who had come in fear, seeking redemption. So when this occurred for him, he changed to being one who wished for something, desiring a gift. So he gave permission to him, due to the fine and noble manners which Allaah had instilled in him, that he (the man) should feed his family, because fulfilling a need comes before expiation.
(taken from Sh Uthaymeen’s explanation of ‘Umdat-ul-Ahkaam
translated by Nasser ibn Najam)