I used to tote a Garand in bear country. I could put a clip of 200 grain bullets into a paper plate at 100 feet in about 8 seconds, time after time.
Before that, I was trapping in Cold Bay, and I carried a Savage Model 24, 22LR above 20 gauge. I carried a load of number 8 shot in the shotgun barrel, and a 20 gauge slug in my pocket. I figured that I'd blast an aggressive bear in the face with the shot, then try to finish him with the slugs. That worked as well as the Garand: I bumped into bears, but never had to shoot at them, with both guns.
Bears usually aren't interested in killing you, but if they smack you around like a cub or a rival bear, you're dead, how ever harmless their actual intention. You need to be prepared for that rare bear who decides to go through you rather than around you, because you probably won't survive that sort of encounter if it all goes the bear's way.
I wouldn't recommend any handgun if I thought I would actually have to shoot at a bear. I believe that you mentioned a 45? If you're talking about the 45 ACP, I'd advise against that. A 454 Casul might have some potential.
What I would recommend is that Garand, or a 12 gauge loaded with slugs.
Nels