You want to carry the largest gun that you can afford, shoot accurately, reasonably carry and afford.
Ideally, you want a .30 rifle or 12 ga shotgun with slugs. I know of at least a couple of black bears that took several .308 rounds to the chest before collapsing. Even so, the .30-30 is a popular black bear hunting rifle.
So, if you are limited to a handgun you want one that best approaches .30 rifle performance. The .44 mag is pretty close to the .30-30 in terms of energy at close range, and throws a heavier, wider bullet. A 4" .44 mag with 270gr - 320 gr. bullets would be the ideal companion as a balance of size/weight and power.
If you don't want something that heavy and want an autoloader then go with bullets of most width and weight first, then speed. Weight equals penetration. Width equals tissue damage when using FMJ or hardcast SWC. The .45 ACP in 230 gr or the a 10mm in 200 gr would be the best common autoloader cartridges, especially if using high speed Double Tap or similar rounds.
Personally, here in the Pacific Northwest I think the chance of tangling with a black bear is low and humans pretty high, so I carry my G23 .40S&W with Double Tap 200 gr FMJ at about 1,000 fps, with backup mags using plain 180 gr FMJ at 950 fps. When I go into an area known to be infested with large black bears unafraid of humans then I carry a much heavier 4" .44 mag with 320 gr JSP or hardcast LSWC and consider the extra weigth as good physical conditioning.