Nick said, "Search the threads. Black bears are not a problem, and require neither spray or guns. For Grizzlies, see what our experienced members who live and hike in Montana or Alaska do. The answers might be surprising."
Editted to add: I live and hike in Alaska. I see several grizzlies and black bears each year. I've dealt with black bears a lot in California and found Banff to be infested with well-behaved grizzlies (my wife and I intentionally took the nice loop with recent bear reports because we figured other people would avoid it. They did.)
I agree broadly that, per bear, black bears are not the problem. There are so many more of them and they overlap human activities so much more that blackies cause some of the deaths, most of the property damage, and virtually all of the sleepless nights due to pot-banging campers.
I never pack a gun and VERY rarely pack pepper spray. I make noise. My somewhat extensive reading of the stats and the research indicate that is how I can most reduce my risk of a bad grizzly encounter. I am totally cool with others carrying spray and data indicate the outcomes are better for spray than guns.
Hiker Jon said, "if (a) problem bears in Yosemite was heading for the tent my two little girls were sleeping in in the middle of popular campground. All I had was a knife and my illegal bear spray. . . (the bear) is charging you or others with obvious malintent, you have to make a choice whether you want to try and ward off an attack from a bear (with gun or bearspray) or very likely spend time in jail."
Oh, my, where to start? I think with my little children who might be camped in the next tent over. Are you so trained and practiced that in the heat of the moment, every shot will hit the bear? No misses? In the dark? No T&Ts? And when was the last bear fatality in Yosemite? I just looked it up. NEVER! So you want to turn a campground into a gun range (in the dark) to prevent something which never happens to millions of people a year.
Even if I grant that you and all people packing would never miss a shot, I as the adjacent father/camper would much rather yell at the bear or run at it with a stick (my usual approach for blackies) than have a wounded bear in camp.
That Ruger LCR has a 2-inch barrel! (Bullets accelerate while in the barrel. They slow down as soon as they leave the barrel). And is only .357! That's a great size for concealed carry and that a great round for humans. Put one round in my chest and I WON'T be doing you any harm for a long time. But bears, even black bears, can be bigger and absolutely can soak up more foot-pounds than you or me.
For me:
Black bears: be careful with your food. Camp where other people are careful with their food. Carry spray if you want and it's allowed.
Grizzlies: make noise. Carry spray if you want. If you carry a firearm, please carry enough gun to be effective. For most Alaskans who do, that's a .338 rifle (about 7-8 pounds). More importantly, know how to use it, know when not to use it, know your backstop at all times, and be wise and decisive in a crisis.

