Salim bin Abdullah narrates from his father (Sayyiduna Abdullah bin Umar, may Allah be pleased with them both) that whenever the Prophet (peace and blessings be upon him) heard thunder or the crash of thunderbolts, he would say: 'Allahumma la taqtulna bi-ghadabika, wa la tuhlikna bi-'adhabika, wa 'afina qabla dhalik' (O Allah, do not kill us with Your wrath, nor destroy us with Your punishment, and pardon us before they come).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الاستسقاء / 6470