عَنْ أَبِي هُرَيْرَةَ قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ: «الرِّيحُ مِنْ روح الله تَأْتِي بِالرَّحْمَةِ وَبِالْعَذَابِ فَلَا تَسُبُّوهَا وَسَلُوا اللَّهَ مِنْ خَيْرِهَا وَعُوذُوا بِهِ مِنْ شَرِّهَا» . رَوَاهُ الشَّافِعِي وَأَبُو دَاوُدَ وَابْنُ مَاجَهْ وَالْبَيْهَقِيُّ فِي الدَّعَوَاتِ الْكَبِيرِ
Translation

Ibn ‘Umar told that when the Prophet heard the sound of thunder and of thunderbolts he said, "O God, do not kill us with Thine anger and do not destroy us with Thy punishment, but preserve us before that happens." Ahmad and Tirmidhi transmitted it, the latter saying that this is a gharib tradition.