On the horns of a dilemma; between equally perilous dangers. . . . “Devil,” in this phrase—as also in “the devil to pay”—is a nautical term. In the days when hulls were of wooden construction, the term was applied to a seam between two planks which, because of its location or of its length, was especially accursed by sailors. In this instance, “devil” probably referred to the seam on a ship’s deck nearest the side; hence, the longest seam on the deck, extending on a curve from stem to stern, and, from its location, a most dangerous one to calk or fill with pitch. Anyone between the devil and the deep (blue) sea had a very narrow footing, a narrow margin for choice.
—Charles Earle Funk, from Heavens to Betsy! and Other Curious Sayings, 1955.