The Gemara asks: What blessing does one recite over rain? Rav Yehuda said that Rav said: We thank you, O Lord our God, for each and every drop that You have made fall for us. And Rabbi Yoḥanan concludes the blessing as follows: If our mouth were as full of song as the sea, and our tongue with singing like the multitude of its waves, etc. And one continues with the formula of the nishmat prayer recited on Shabbat morning, until: May Your mercy not forsake us, O Lord our God, and You have not forsaken us. Blessed are You, O Lord, to Whom abundant thanksgivings are offered. The Gemara asks: Why does the blessing specify abundant thanksgivings and not all thanksgivings? Rava said: Emend the formula of the blessing and say: God of thanksgivings. Rav Pappa said: Therefore, as there are differences of opinion on this, we will recite them both: God of thanksgivings, and: Abundant thanksgivings.
(א) ברכת הודאת הגשמים ובו ב סעיפים:
אם היו בצער מחמת עצירת גשמים וירדו גשמים מברכים עליהם... הגה: ומה שאין אנו נוהגים בזמן הזה בברכת הגשמים משום דמדינות אלו תדירים בגשמים ואינן נעצרין כל כך (סמ"ג ואגור וכל בו):
(ב) ומה מברך אם אין לו שדה אומר מודים אנחנו לך ה' אלהינו על כל טפה וטפה שהורדת לנו ואילו פינו מלא שירה כים וכו' עד הן הם יודו ויברכו את שמך מלכנו וחותם בא"י אל רוב ההודאות ואם יש לו שדה בשותפות עם אחר מברך הטוב והמטיב ואם אין לו שותף בשדה מברך שהחיינו:
If there was danger because of drought, and then it rained, one blesses over the rain...
Rema: The reason that we don't have the practice of blessing the rain today is because in these lands, rain is common and drought is infrequent.
What does one bless?
If they do not have a field, one blesses:
"We thank you, O Lord our God, for each and every drop that You have made fall for us, and if our mouth were as full of song as the sea, etc. until they will thank and bless your name, our Ruler." And one closes with: "Blessed are You, Adonai, God of abundant thanksgivings."
If one co-owns a field with another, one blesses: "who is good and does good."
If one owns a field without a partner, one blesses "shehecheyanu."
"drought is infrequent"-- that is to say, rainfall does not bring them joy. And thus also even in places where rain is common, if there was a drought and the world was in trouble, and then it rained, one is obligated to bless.