I've been down the same path. Ended up debating between glock 10mm and larger revolver. Ended up going with a 4" barrel 500 S&W loaded with my reloads of 440 gr wide flat nose hard cast bullets at a moderate velocity so recoil isn't a bear (haha). My reasoning was that I probably won't get many shots off before it's on top of me and that if I need to stick the barrel in the bears mouth and pull the trigger once or twice, I want the bullet to be as big and bad as possible. My preference is also for the trigger on the Smiths over the Ruger.
I feel like a 10mm would have an advantage if you have a hunting buddy - if the bear is on top of them, you can just rip off endless shots and visa versa. Bears typically take turns attacking each person if there are two people.
The other thing to think about is night time. I cannot find night sights for my 500. I also cannot mount a flashlight onto the gun, so I have to hold the flashlight in my left hand and cross brace under my strong hand (if that makes sense) to see at night. Single handed 500 S&W shooting is exciting. For this reason, I'm thinking about also purchasing a 10mm.
This link is a pretty good read on how attacks usually go down. Helps a little bit to put yourself in to the situation.
GUN WATCH: Defense Against Bears with Pistols: 97% Success rate, 37 incidents by Caliber
Both the 10mm and a larger revolver have advantages. Which do you want to bet your life on?