Burt Bacharach and Hal David wrote the song called "The Man Who Shot Liberty Valance."
The singer of the song is Gene Pitney, the song became a Top 10 Hit but was not used in the movie. Instead, the main titles contain a hard-driving theme used in an earlier John Ford production. James Taylor covered the Bacharach–David song on his 1985 album That's Why I'm Here. The Royal Guardsmen also covered the song in their 1967 album Snoopy vs. the Red Baron.
The Man Who Shot Liberty Valance is a gorgeous composition and the singer really knows how to sing it.
In certain scenes involving the character of Hallie, Ford used part of Alfred Newman's "Ann Rutledge Theme" from his earlier movie Young Mr. Lincoln. Ford told Peter Bogdanovich in the latter's book John Ford that the theme evoked the same meaning, lost love, in both movies.