As I posted earlier I have had many close encounters with both black and grizzly bear. I've written extensively on this. I've been stalked, bluff charged, even tripped over a small blackie as a kid living in Yosemite. We spend summers in the Rockies and I usually add a few more bear stories each year.
1. You don't have to kill bear. You need to understand them. Before you accuse me of being a bleeding heart liberal tree hugger

I shot my first and only bear at 17 with a .30-30. What I mean, is understand the different reactions of black vs brown (griz) bear.
Black bear will usually (put "usually" in front of most of these comments) run off if you yell and wave arms and don't corner them. Grizzly are just plain mean. They are the apex predator, so show respect. Talk calmly, back away slowly, try to convey you aren't food or a threat. If that doesn't work...
2. I carry Counter Assault bear spray. The big can with a 40 ft fog. Anybody here know Todd Orr up in MT? I've talked with him a few times since his attack. He was attacked twice by a grizzly. In Todd's case the bear ran right through the spray and mauled him. The second time it hit him so fast and hard he lost hold of his gun. Since then I carry TWO cans hiking in grizzly areas.
3. Guns: My opinion - a shotgun or high power rifle is best. 12 ga slugs, .30-06, .45-70, .375h&h, maybe .308 on the low end will be most effective on grizzly. An AK mag dump on full auto would probably work too. Pretty much any gun seems to stop blackies.
But, unless hunting, long guns aren't socially acceptable in many places bear frequent. Carry a shotgun in Yellowstone and tell us how your day goes.
4. My pistol of choice in grizzly/moose areas is a .44 mag Redhawk, usually in a chest rig. But it seems whenever I have a close encounter I'm carrying my Glock 19. So now I carry a spare mag of Buffalo Bore and swap it for my HP defense rounds in grizzly areas. If I lived in Alaska or Montana I'd probably go with a bigger pistol, 10mm, .454, .50 bmg(?).

But I can't justify the cost based on our minimal threat level. A .45 with BB is probably adequate too in the lower 48. In black bear country I think anything .38 up will work (usually).
So what is my plan? Carry your tools ready to hand. I keep one can of spray on my chest harness or pack strap. One on my belt or in my hip pocket. Bear spray in left hand, pistol in right. If I had time, to even deploy either, the plan is fire pepper gas at 15 yards (45 ft). If it doesn't turn almost immediately you have maybe 2 seconds, drop spray and fire handgun until empty or dead.
Keep in mind if you think you will shoot a charging grizz with a pistol. Your effective target area is about 12"x24", and it's bouncing up and down about a foot. Good luck until it's pretty close.
Reality is deer, bees and ladders kill more people than bear. In 95% of cases verbal and physical movement will suffice. In 4% spray will solve the problem. In 0.5% a gun will stop the threat.
And the last 0.5%, well the bear wins.