“Allahumma inna na’udhu bika min sharri ma ursila bihi (O Allah, we seek refuge with You from the evil of that with which it is sent).” Then if it rained he would say: “Allahumma sayyiban nafi’an (O Allah, a beneficial rain),” two or three times. And if Allah dispelled it and it did not rain, he would praise Allah for that. (Using translation from Ibn Mājah 3889)
أَنَّ رَسُولَ اللهِ ﷺ كَانَ إِذَا رَأَى سَحَابًا مُقْبِلًا مِنْ أُفُقٍ مِنَ الْآفَاقِ تَرَكَ مَا هُوَ فِيهِ وَإِنْ كَانَ فِي الصَّلَاةِ حَتَّى يَسْتَقْبِلَهُ فَيَقُولُ اللهُمَّ إِنَّا نَعُوذُ بِكَ مِنْ شَرِّ مَا أُرْسِلَ بِهِ فَإِنْ أَمْطَرَ قَالَ اللهُمَّ سَيْبًا نَافِعًا اللهُمَّ سَيْبًا نَافِعًا وَإِنْ كَشَفَهُ اللهُ وَلَمْ يُمْطِرْ حَمِدَ اللهَ عَلَى ذَلِكَ