Here is what Gillie posted in 2011 about this episode and the song in particular:
"Greg Walcott came up with the idea of the song, "Under the Red Rock Rim", while he was discussing his role of Danny Morgan for this show with David Dortort. Greg said he couldn't sing very well, but gave it a try for David over the phone. He liked it and David Rose joined the conversation. In less then 30 minutes, they composed the song over the phone.
Greg reported to the recording studio at Paramount and sang the song in different variations. A guitarist came in and did the playing for the instrumental part of the duet. One completed, the recordings were played back on the sound stages and the guitarist was out of camera range, playing the chords, when Greg would lip synch to them and fake the strumming in his scenes.
Walcott finished the 6-day shoot and he went to seek other work. Post-production followed immediately and this is where the film dubbing was done. Pernell reported to the studio to voice dub the song for all the scenes of Danny singing, and that includes the night scene where Adam is shot off the horse by the Reverend Johnson. "
Thread: Question about "Song in the Dark"