I ma amazed at the number of great shots there are that figure they can drop a charging bear in the one second they will have after they are surprised and it charges them from 25 metres away.
Polar Bears hunt humans, the best polar bear gun is the one the Inuit with you is carrying.
Grizzly bears want your food, the only purpose a gun has is to "dust" them with a light buckshot from 50 or 60 yards away to scare them away from your food cache. This is after they have ignored the flares and bombs.
Black bears are the troublesome ones, unpredictable, crazy and fast. At least with bear spray you have a chance of hitting the bear: assuming you have the cool to wait until just before he hits you; and assuming the bear is not already snacking on you through the tent.

As to whether bear spray is effective,,,,. I would rather not know.
BearTracks in KuglukTerritorial Park These were found about 50 metres from our cooking site at the edge of the Coppermine River just inside the park. They were about 2 days old. Our campsite was on top of the tundra about 200 metres away. When we returned to Calgary our bear bombs were still in the plastic packaging and the bear spray had all the security locks still on. (The small print was too small for our middle-aged eyes to focus on

)
The only real bear protection is be aware of the bear before it is aware of you.
IMHO
LF