A last-minute burst of inspiration turned the song into a defining hit that has remained a rock radio staple for decades.