Having lived in Alaska for 45 years and tons of time in the backcountry, I have strong opinions about this topic. Here are a few:
1) Bears are incredible animals, nothing is guaranteed to stop them, you just choose what is most likely.
2) In Alaska bear spray has a proven track record of being by far the best method of defense with the least likely-hood of making the situation worse or failing you.
3) Guns are an extremely poor choice for many, many reasons:
*They are too heavy and awkward to have with you at all times. I personally have drug guns all over Alaska, then set it down and walked to the creek for water and run into a bear there. Bear spray can literally be with you 99% of the time and that will not be true of a gun.
* The easier a gun is too carry, the less useful it is. I've drug a .44 all over Alaska, despised it every second, and knew the whole time that if I ever had to use it would NOT kill the bear but would make it certain to kill me instead of just maul me and then leave.
*Brown Bears often BLUFF CHARGE. They just want to scare you away and then get their cubs away from you to safety. Pepper spray won't make it worse, but may make it better. Shoot it once with a gun and now its no longer a bluff--it wants desperately to kill you. Very, very few guns will kill a bear with one shot dead in its tracks--ain't gonna happen. A famous outdoor writer in Alaska (Craig Medred shot a bear one time with a 454 Cassul, the bear mauled him and then ran away and died. Craig was lucky and lived.
* Guns are too SLOW to bring to aim and firing position. Bears are incomprehensibly fast! Bear spray in a shoulder holster can be fired without even removing it from the holster, just twist it around to aim--and it can easily be their 100% of your waking day.
Bear Spray may not be ideal, guaranteed or perfect--BUT, it is far, far, far better than a firearm.
Bob