Sayyiduna Ibn Umar (may Allah be pleased with them both) said that when the Messenger of Allah (peace and blessings be upon him) heard thunder and thunderbolts, he would say: "O Allah, do not destroy us with Your wrath, and do not ruin us with Your punishment, and grant us well-being before that."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 13173