Daniel Cameron, the attorney general, will face Andy Beshear, a popular Democrat who is seeking re-election in a typically deep-red state.