"The Sons of Katie Elder" is the theme song for the 1965 Paramount western of the same name starring John Wayne. It was written by Ernie Sheldon (words) and Elmer Bernstein (music).
The song, as recorded by Johnny Cash, wasn't used in the actual film, but appeared on its soundtrack LP. Released as a single by Columbia Records (Columbia 4-43342, with "A Certain Kinda Hurtin'" on the opposite side), in July 1965, the song became a U.S. country top-10 hit.
According to the book Johnny Cash FAQ: All That's Left to Know About the Man in Black, the song used "virtually the same music and arrangement" as a song titled "Thunderball" that Johnny Cash had recorded as a potential title song for the James Bond movie of the same name during the sessions for the double album Johnny Cash Sings the Ballads of the True West. Cash's version of the song was rejected in favor of Tom Jones' one, and
The book The Man in Song: A Discographic Biography of Johnny Cash tells a slightly different story:
Cash recorded the song on June 11, 1965, at the Columbia Studio in Nashville, Tessessee.