Sayyiduna Imran bin Husayn (may Allah be pleased with him) says: We were with the Messenger of Allah (peace and blessings be upon him) on a journey, (and he mentioned the hadith). The call to prayer was given and he (peace and blessings be upon him) led the people in prayer. When he turned away from the prayer, he saw a man sitting apart who had not prayed with the people. He (peace and blessings be upon him) said: "O so-and-so! What prevented you from praying with the people?" He said: O Messenger of Allah! I became junub (in a state of major impurity) and there was no water. The Messenger of Allah (peace and blessings be upon him) said: "You should have used clean earth, for it suffices." And then he narrated the long hadith, (in which) he says: He (peace and blessings be upon him) gave him a vessel of water and said: "Go and pour it over yourself."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 846