Do what ever you want to do as far as a hand gun goes.
Hunters know that unless you get a shot into the brain or spinal area, the bears can still attack and do much damage before expiring.
Recent reports and tests have shown that Bear Spray is the best defense. The above funny posts are funny.
I would certainly have a large cal pistol handy if the bear recovered before you could get out of the area.
Think about it........If a Griz is coming at you faster than a horse can run, and your stated inexperience with a handgun, do you think you could draw from some backpack area and hit one coming at you.......Probably not. They would be on you within a second or two from 40 yards away. Current laws in the areas allow one to carry a gun but not on the hip.
With the bear spray that one can carry on the hip, you put up a wall of spray that will stop a bear long before a bullet will if the bullet is not put into a precise area.Do what you want to do, but this is my advise.
+1 for this. Good luck.