"Long Black Veil" is a 1959 country ballad, written by Danny Dill and Marijohn Wilkin. The writers later stated that they drew on three sources for their inspiration: Red Foley's recording of "God Walks These Hills With Me", a contemporary newspaper report about the unsolved murder of a priest, and the legend of a mysterious veiled woman who regularly visited Rudolph Valentino's grave. Dill himself called it an "instant folksong."
This was first recorded by Lefty Frizzell and subsequently by Joan Baez, Johnny Cash and many others. I learned it from the Joan Baez recording.