This has been done about a million tomes on CGn ,but of course, I will participate.
Best gun for bear defense is the one you have in your hands at the time, whether it's a .22LR or a .458...
Most important is the gun you are comfy with and have practiced with.
Very important is that you will actually HAVE the gun, rather than leave it leaning against a tree or in the truck because it's too heavy/cumbersome
There are places in BC where it is foolish not to take a powerful firearm for grizzly defense. In those places, I'd take my .375 Ruger, but I have also packed a .375 H&H and a 12 guage with slugs.
Most bear attacks are black bears
Unless I am going into a grizz area, I now take a .45 Colt Lever action with 300gr cast bullets or a 14" barrel shotgun with slugs. (preferably Brennekes) This is because they are light and non cumbersome, and will do the job if necessary and I keep my cool enough to shoot well.
MAny times, I'd prefer a handgun, but Canada frowns upon that for the most part.
Any gun you choose- a defender shotgun, a .303 SMLE. a 30-30. a .458 and anything in between or sideways- Is useless unless you practice with it and know how to shoot fast at close range.
Using your brain to avoid bad bear encounters trumps any gun.