Sahih Bukhari Volume 3, Book 36, Hadith Number 472.
The Prophet added, “The second man said, ‘O Allah! I had a cousin who was the dearest of all people to me and I wanted to have sexual relations with her but she refused. Later she had a hard time in a famine year and she came to me and I gave her one-hundred-and-twenty Dinars on the condition that she would not resist my desire, and she agreed. When I was about to fulfill my desire, she said: It is illegal for you to outrage my chastity except by legitimate marriage. So, I thought it a sin to have sexual intercourse with her and left her though she was the dearest of all the people to me, and also I left the gold I had given her. O Allah! If I did that for Your Sake only, please relieve us from the present calamity.’ So, the rock shifted a little more but still they could not get out from there.”
The Prophet added, “Then the third man said, ‘O Allah! I employed few laborers and I paid them their wages with the exception of one man who did not take his wages and went away. I invested his wages and I got much property thereby. (Then after some time) he came and said to me: O Allah’s slave! Pay me my wages. I said to him: All the camels, cows, sheep and slaves you see, are yours. He said: O Allah’s slave! Don’t mock at me. I said: I am not mocking at you. So, he took all the herd and drove them away and left nothing. O Allah! If I did that for Your Sake only, please relieve us from the present suffering.’ So, that rock shifted completely and they got out walking.