While the link given above suggests a handgun with the wording, "the hiker pulled out his gun and shot the bear at close range.", other news reports:
report that a shotgun was used. Which is a whole more likely (because it is more legal) to be carried in Canada. The OP's link makes it sounds like the use of the gun was what stopped the attack. The article linked above describes:
"The man was able to get his bear spray out and when he sprayed the sow, she retreated but went after the second man, who fired a shotgun at her and, according to his report, struck her at a fairly close distance, Caravetta said.
The bear continued to attack the man, biting his upper arm and chest before retreating.
"Perhaps once the bear had him down, she felt the threat was gone," Caravetta said, adding the attack is considered defensive and not predatory."
Indicating that, for this attack, this bear, this turn of events; pepper spray stopped the attack on the first man, a shotgun didn't stop the attack on the second man - his going down stopped the attack. UL note: Pepper Spray = 14 oz and worked, shotgun = 6 pounds and didn't work, duck&cover = 0 oz and worked albeit with some injuries.)
And, as Jerry has been pointing out: ""We're not pursuing the bear because it's a bad bear, we're pursuing it because we think it's wounded," Caravetta said, adding depending on the severity of its injury, the bear would have to be euthanized and the cub likely taken somewhere to be rehabilitated."
Spray: +1 Gun: 0
Humans -0.05 Bears: -1
Gun forums are pondering what gauge shotgun and what load (buckshot, slug, etc) was used, and have the implicit or explicit idea that if he carried the right weapon, the bear would have gone down instantaneous. Having seen a medium-sized black bear take two .338 bullets (3800 foot-pounds versus a 1-ounce 12-gauge slug at 1000 foot-pounds) and keep going, I know that's not always true.
I ponder "How much noise were they making immediately before the encounter?" I wish (like seat belt use in a MVA) that was a standard interview question and included in more news reports. UL note: yelling weighs nothing.