Knowledge
When picking a firearm, start with the bullet first. Once you determine the bullet you want to deliver on target and the velocity, find cartridges that deliver. Then make a list of all the firearms that chamber that cartridge loaded to that performance level. Then pick from that list.
High energy bullets shred flesh. High momentum bullets break bone. Bears only get angry when you hurt them. To stop one fast, you have to break bone.
However, those were (originally) my concluding paragraphs. Here is my advice.
Know your threat. This advice applies equally well in the wilds of Africa, the woods of North Carolina or the streets of Washington D.C. (or their smoke-filled rooms, too).
Predators of the feline variety rarely attack from the front. Stealth hunters, you are unlikely to have enough time to draw a gun.
Bears, are defensive of their offspring and will attack (or run) without regard to your circumstances, but according to theirs. You might get warning. Around here, Brown/Grizzly bears, the conventional wisdom is to play dead. With our Black Bears, that tactic will get you eaten. Brownies don't favor humans for food and they are the top predator. Picky eaters. Black Bears, if they have not run from you, are just as likely to want to make a meal of you.
If you want to instantly stop any large predator no handgun is really adequate, though the 500 Smith comes darned close. Even a medium black bear can absorb a tremendous amount of energy and still eat your lunch (before dying itself). A mortally wounded bear can live for quite a long time before expiring. Unless you take out the central nervous system (hard shot to make) or break a major bone (enough to slow a bear down so you can take a more leisurely kill shot).
Across the Northern Tier, (Alaska, Canada, Greenland, Polar regions) bear spray has a MUCH better track record of keeping humans uninjured than firearms.
Of firearms, 12 Gauge with Brenneke slugs is highly favored. 45-70 Carbine is very popular. The 500 S&W is the most effective handgun, but expensive and heavy. Handguns are very hard to hit well with. My usual advice is to go to an outdoor area with a good backstop and a long, sloped area heading toward the firing line. Take a soccer ball (about the size of a bear's vitals, right?) and prop it on the slope with a piece of wood. Turn away from the ball. Have a friend shoot the prop out from under the ball (or if (s)he is not such a good shot, use a string) and when the ball is ten meters from you and rolling/bouncing at least 20 mph, your friend tells you to turn. Draw and fire. How many times can you hit it with a handgun? a shotgun? bear spray? Extra points if you can hit only the black spots on the ball.
The best way I know of to ruin a good fishing trip or hike in the woods is to shoot any animal in defense of life or property. Alaska Troopers investigate every DLP shoot. You are responsible to report the incident and to preserve the skull and hide. The State becomes the owner of the cape. You get to keep nothing but a copy of the investigation report and any pictures you manage to take (and the story, of course).
Spray a bear and you are morally obligated to report it (to keep other hikers safe), but you have preserved wildlife, taught a bear that humans are more trouble than they are worth and kept yourself safe.
Drawbacks of spray are that they are not reloadable, and if you have a second encounter, you may be short of ammunition.
When I am in the woods, I carry spray and a 454 Casull, but, given the choice, will use the spray first. If carrying only one, the spray. But not the wimpy anti-personnel sprays. 8-10 oz, 10% oleoresin capsicum (or the newer UDAP).
On .357 Magnums and barrel length: When the .357 was invented, it was designed when 6" barrels were the norm and 4" was considered a "shorty". To me, the .357 IS a 6" cartridge (or longer). With more modern powders, you give up less power in the 4" barrel than you did with the powders available in 1934, but a 33% cut in barrel length seems significant to me. My 454 is 7.5"; worn in a cross-draw holster on my strong side, it is right under my hand and fairly fast in presentation.
Bullet selection: Heavier is better, solid, hard cast with a wide meplat. Penetration to vitals is delivered by the weight. Hard cast keeps the bullet together and the flat front provides disruption.
Good luck. Thanks for asking our advice.
Lost Sheep