It is narrated from Amir: I asked Alqamah: Was Ibn Mas'ud (may Allah be pleased with him) with the Prophet (peace and blessings be upon him) on the night of the jinn? He said: I asked Ibn Mas'ud (may Allah be pleased with him): Was any of you with the Messenger of Allah (peace and blessings be upon him) on the night of the jinn? He said: No, but one night we were with the Messenger of Allah (peace and blessings be upon him) and we missed him, so we searched for him in the valleys and the mountain passes. We said: He (peace and blessings be upon him) has been carried off or assassinated. We spent the worst night that any people have ever spent. When morning came, there he (peace and blessings be upon him) was, coming from the direction of Hira. We said: O Messenger of Allah, we missed you and searched hard for you, but we could not find you, and we spent the worst night that any people have ever spent. He (peace and blessings be upon him) said: "The caller of the jinn came to me, so I went with him and recited the Qur'an to them." The narrator said: Then he (peace and blessings be upon him) took us and showed us their traces and the traces of their fires. They had asked him (peace and blessings be upon him) for provision, and he (peace and blessings be upon him) said: "Every bone over which the name of Allah has been mentioned will fall into your hands as full of meat as it can be, and every piece of dung is fodder for your animals." Then the Messenger of Allah (peace and blessings be upon him) said: "Do not clean yourselves with these two, for they are the food of your (jinn) brothers."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 528