According to band member Robby Krieger, it was inspired by the song "(Ghost) Riders in the Sky: A Cowboy Legend." The song is played in the E Dorian mode, and incorporates real sound effects of thunder and rain, along with Ray Manzarek's Fender Rhodes electric piano playing, which emulates the sound of rain.
The song was recorded at the Doors Workshop in December 1970 with the assistance of Bruce Botnick, their longtime engineer, who was co-producing the recording sessions. Jim Morrison recorded his main vocals and then whispered the lyrics over them to create the echo effect. This was the last song recorded by the members of The Doors, according to Manzarek, as well as Morrison's last recorded song to be released. The single was released in 1971, shortly before Morrison's death, entering the Hot 100 on 3 July 1971, the day that Morrison died.