Lesser of two evils

The less bad thing of two bad things.

The voters had to choose the lesser of two evils when they voted for one of the two candidates for mayor.