Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bukhari:1015Musaddad > Abū ʿAwānah > Qatādah > Anas

Anas I said, "While Messenger of Allah ﷺ was delivering the Friday Khutba (sermon) a man came and said, 'O Messenger of Allah ﷺ! Rain is scarce; please ask Allah to bless us with rain.' So he invoked Allah for it, and it rained so much that we could hardly reach our homes and it continued raining till the next Friday." Anas further said, "Then the same or some other person stood up and said, 'O Allah's Apostle! Invoke Allah to withhold the rain.' On that, Messenger of Allah ﷺ I said, 'O Allah! Round about us and not on us.' " Anas added, "I saw the clouds dispersing right and left and it continued to rain but not over Medina."  

البخاري:١٠١٥حَدَّثَنَا مُسَدَّدٌ قَالَ حَدَّثَنَا أَبُو عَوَانَةَ عَنْ قَتَادَةَ عَنْ أَنَسٍ قَالَ

بَيْنَمَا رَسُولُ اللَّهِ ﷺ يَخْطُبُ يَوْمَ الْجُمُعَةِ إِذْ جَاءَ رَجُلٌ فَقَالَ يَا رَسُولَ اللَّهِ قَحَطَ الْمَطَرُ فَادْعُ اللَّهَ أَنْ يَسْقِيَنَا فَدَعَا فَمُطِرْنَا فَمَا كِدْنَا أَنْ نَصِلَ إِلَى مَنَازِلِنَا فَمَا زِلْنَا نُمْطَرُ إِلَى الْجُمُعَةِ الْمُقْبِلَةِ قَالَ فَقَامَ ذَلِكَ الرَّجُلُ أَوْ غَيْرُهُ فَقَالَ يَا رَسُولَ اللَّهِ ادْعُ اللَّهَ أَنْ يَصْرِفَهُ عَنَّا فَقَالَ رَسُولُ اللَّهِ ﷺ اللَّهُمَّ حَوَالَيْنَا وَلاَ عَلَيْنَا قَالَ فَلَقَدْ رَأَيْتُ السَّحَابَ يَتَقَطَّعُ يَمِينًا وَشِمَالاً يُمْطَرُونَ وَلاَ يُمْطَرُ أَهْلُ الْمَدِينَةِ  


See similar narrations below:

Collected by Bukhārī
bukhari:6342Muḥammad b. Maḥbūb > Abū ʿAwānah > Qatādah > Anas

While the Prophet ﷺ was delivering a sermon on a Friday, a man stood up and said, "O Messenger of Allah ﷺ! Invoke Allah to bless us with rain." (The Prophet ﷺ invoked Allah for rain.) So, the sky became overcast and it started raining till one could hardly reach one's home. It kept on raining till the next Friday when the same man or another man got up and said (to the Prophet), "Invoke Allah to withhold the rain from us, for we have been drowned (with heavy rain )." The Prophet ﷺ said, "O Allah! Let it rain around us and not on us." Then the clouds started dispersing around Medina and rain ceased to fall on the people of Medina.  

البخاري:٦٣٤٢حَدَّثَنَا مُحَمَّدُ بْنُ مَحْبُوبٍ حَدَّثَنَا أَبُو عَوَانَةَ عَنْ قَتَادَةَ عَنْ أَنَسٍ ؓ قَالَ

بَيْنَا النَّبِيُّ ﷺ يَخْطُبُ يَوْمَ الْجُمُعَةِ فَقَامَ رَجُلٌ فَقَالَ يَا رَسُولَ اللَّهِ ادْعُ اللَّهَ أَنْ يَسْقِيَنَا فَتَغَيَّمَتِ السَّمَاءُ وَمُطِرْنَا حَتَّى مَا كَادَ الرَّجُلُ يَصِلُ إِلَى مَنْزِلِهِ فَلَمْ تَزَلْ تُمْطَرُ إِلَى الْجُمُعَةِ الْمُقْبِلَةِ فَقَامَ ذَلِكَ الرَّجُلُ أَوْ غَيْرُهُ فَقَالَ ادْعُ اللَّهَ أَنْ يَصْرِفَهُ عَنَّا فَقَدْ غَرِقْنَا فَقَالَ اللَّهُمَّ حَوَالَيْنَا وَلاَ عَلَيْنَا فَجَعَلَ السَّحَابُ يَتَقَطَّعُ حَوْلَ الْمَدِينَةِ وَلاَ يُمْطِرُ أَهْلَ الْمَدِينَةِ