It is narrated from Sayyiduna Jabir bin Abdullah (may Allah be pleased with him), he says: I used to perform the Zuhr prayer with the Messenger of Allah (peace and blessings be upon him), and due to the intensity of the heat, I would take a handful of pebbles in my palm so that they would cool down and then I could prostrate on them. In another narration it is stated: Due to the intensity of the heat, I would transfer them to the other hand so that they would cool down.
Hadith Referenceالفتح الربانی / أبواب الأذ كار الواردة عقب الصلاة / 1903
Benefits: … Subhan Allah! This was the faith of the noble Companions (radi Allahu anhum) that even the intense heat of midday and the scorching ground did not affect their prayers. From this hadith, it is understood that a person performing prayer (the worshipper) may do such an act in order to remove his hardship.