To choose between two, in some way equally problematic, situations.
Hmmm. To be face down Old Nick himself, evil incarnate, on one hand, or, on the other hand, the endless danger of the fathomless, roiling sea… sounds harrowing. But actually the choices represented by this idiom are pretty mild, and the phrase is usually used in the spirit of fun or for dramatic effect.