This topic gets done millions of times...for good reason!
These threads are fun! Okay, I'm not sure why you'd ever have just one gun, and there are places I'd never even go with just one gun! Now that that's out of the way...
There are no bears where I live. The kind of bear would influence my decision! If we're just talking black bears I wouldn't be afraid to simply carry a 9mm, .40 cal or .45 ACP. Generally blacks don't weigh a lot more than a human (although my dad once shot a 400 lb black bear sow). The owner of Buffalo Bore has a lot of bear experience; he says that hurting a black bear is enough to drive it off, but that if he has to kill one a 9mm with solids is enough. If I'm going with a 9mm it will be one of my HKs, either a P30S, USPf9 or VP9. I'll have between three and six mags on me (it would depend on the type and length of trip), 15 rounds per mag. I'll carry 147gr Federal HST in the gun but I'll have at least one mag filled with 147gr ball.
If we're talking Alaska then I'd need to buy another gun! I recently traded my Remington 870 Tactical 12ga in towards an HK USPc I couldn't live without.
I realize that I do need to get anther shottie down the road. For Alaska I'd probably go with a 12ga, probably a Remington 870 of some kind due to familiarity with it. I would have it loaded with Brenneke slugs because they offer better penetration than anything else I've seen. My old 870 had a sidesaddle holding 7 rounds, and I'd probably do that to my next shottie as well. Again, length of the trip and the distance from civilization would partly dictate my ammo load out, but I would like to have at least 50 rounds of ammo. Shotgun shells are bulky and heavy but I'd pack at least 18 slugs, around 15 or so buckshot with the rest being birdshot between 7s and 9's. For survival it would be nice to up your odds of getting geese or small game.
When I camp and hike here I normally carry the same guns I CCW around town. But I'll often carry in my Hill People Gear Kit Bag. It's a chest rig that's fast and easy to draw from and has room for additional stuff. When in the woods I like the USPf9 because that's the one I have outfitted with a light (Inforce APL). Maybe I'm paranoid but it's not at all uncommon for me to carry the USP in my chest rig and a second gun IWB. The 2nd gun might be my P30S, Beretta Nano or Ruger LCR.
If I owned one a sidearm in 10mm or 9x25 Dillon would also rock! Lots of power and good penetration with the right ammo. A .357 Mag would be a great choice except maybe in Big Bear country. Then a .44 Mag would be a better choice. But I have very little confidence in my ability to stop a bear charge with a double action revolver! I'd much rather have the shotgun.
Lastly, in many/most cases a rifle would be much better. It would come down to legality and whether a long gun would draw unwanted attention. I would take a SCAR 17 with a hundred rounds of various 7.62 loadings for virtually any part of the planet not covered with water!
While not ideal for big bear I would find 20 rounds of .308 to be pretty comforting.