The Rain in Spain
"The Rain in Spain" is a song from the musical My Fair Lady, with music by Frederick Loewe and lyrics by Alan Jay Lerner. The song was published in 1956.
The song is a turning point in the plotline of the musical. Professor Higgins and Colonel Pickering have been drilling Eliza Doolittle incessantly with speech exercises, trying to break her Cockney accent speech pattern. The key lyric in the song is "The rain in Spain stays mainly in the plain", which contains five words that a Cockney would pronounce with [æɪ] or [aɪ] – more like "eye" [aɪ] than the Received Pronunciation diphthong [eɪ]. With the three of them nearly exhausted, Eliza finally "gets it", and recites the sentence with all "proper" long-As. The trio breaks into song, repeating this key phrase as well as singing other exercises correctly, such as "In Hertford, Hereford, and Hampshire, hurricanes hardly ever happen", in which Eliza had failed before by dropping the leading 'H'.

Origin
The phrase does not appear in Shaw's original play Pygmalion, on which My Fair Lady is based, but it is used in the 1938 film of the play. According to The Disciple and His Devil, the biography of Gabriel Pascal by his wife Valerie, it was he who introduced the famous phonetic exercises "The rain in Spain stays mainly in the plain" and "In Hertford, Hereford, and Hampshire, hurricanes hardly ever happen" into the script of the film, both of which were later used in the song in My Fair Lady.

In other languages
Versions of "The rain in Spain stays mainly in the plain" in various languages include:

Danish: "En snegl på vejen er tegn på regn i Spanien" ("A snail on the road is a sign on rain in Spain")
Dutch: "Het Spaanse graan heeft de orkaan doorstaan" ("The Spanish wheat has survived the hurricane")
German: "Es grünt so grün, wenn Spaniens Blüten blüh'n" ("it turns so green when Spain's flowers bloom")
Hebrew: "ברד ירד בדרום ספרד הערב‎" ("Barad yarad bidrom sfarad haerev": Hail fell in southern Spain this evening.)
Hungarian: "Lenn délen édes éjen édent remélsz."
Italian: "La rana in Spagna gracida in campagna" ("The frog in Spain croaks in the country side")
Polish: "W Hiszpanii mży, gdy dżdżyste przyjdą dni" ("It drizzles in Spain when come the rainy days")
Spanish: "La lluvia en Sevilla es una pura maravilla" (The rain in Sevilla is a true marvel) playing with the sound of the "ll").

Usage in other popular culture
The satirical revue Forbidden Broadway set up playwright David Mamet as being exasperated with Madonna's acting style with the lyrics, "I strain in vain to train Madonna's brain." The song is included on the album Forbidden Broadway, Vol. 2.
In 2012, a punk rock version of "The Rain in Spain" was featured in comedy-musical TV series Glee, episode "Choke". The song was performed by Mark Salling (as his character Puck) and the guys of the series' fictional glee club New Directions.

References
External links
"Barad yarad bidrom sfarad": How "The Rain in Spain" Fell in Eretz-Israel, by Dan Almagor
"The Rain in Spain" from "My Fair Lady" on YouTube, 2001 London revival
"The Rain in Spain (My Fair Lady)" from "Hey Mr Producer" on YouTube, 1998 live recording of "Hey, Mr. Producer!"
"The Rain in Spain" from "An Evening with Alan Jay Lerner" on YouTube, 1987 live recording of "An Evening with Alan Jay Lerner" (feat. Plácido Domingo, Liz Robertson, Richard Caldicot)