It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "When you hear the thunder, remember Allah, for it does not strike one who is remembering Him."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11323