It all depends on the bear!
If it's a normal black bear like we have around my area, a 30-30 or 44mag or anything like that will work fine.
For Alaskan bear, especially the real big brownies, I'd want all the gun I could get.
It has been shown that a .338 Magnum will do it well, but a .375 Mag or 416 mag might be even better, especially on something like a Kodiak.
I've never hunted Alaskan bear, but I know that I'd want to be sure that they didn't get to me. I've heard tales that the best way is to break the shoulder with the first shot, so they can't charge you easily, and then finish them off after that. Preferably from as much distance as you can shoot from.
45-70 has been getting it done for a long time, and that's a good close-quarters brush gun. I'd prefer to have a little more distance between me and the bear!
This guy had some brass balls to do this.