I had that feeling. What would give you a real margin of safety? A bazooka?
Honestly? A lot of distance and a big game repeater rifle. .375 H&H, .50 BMG, .600 Nitro Express, something like that. Bears tend to be sprinters.
Angry bears are a lot like humans on PCP or other such drugs - you can actually cause enough damage for them to die but they keep going until their brains shut down for lack of oxygen. At "hiking through the woods" distances, about the only way to stop them before they get to you and kill you is to destroy the brain, or alternately use something that blows enough limbs off the bear (rocket or contact grenade or something) that it physically cannot pursue you.
.50 BMG!
20mm, but it's really heavy and requires payment of an unconstitutional $200 NFA tax.