Yes, your 9mm or snub nose 38 special will be just fine.
( That seems to be the answer you want to hear.)
Don't have much experience with bears. Only shot one.
Quartered away from me at about 80 yards. Slid a 130 grain 270 Winchester at about 3000 fps. behind the near shoulder, thru the lungs, and hit the far shoulder. ( didn't know that at the time,, looked like a good shot behind the shoulder, but the way he took off I started to have doubts )
Covered about 35 to 40 yards before I could work the bolt. Had to track it thru thick cover for another 60 yards..
At the time I was sure wishing I had something bigger with me than the 270.
But that was all I had. If a 38 special or a 9mm is all you have ,,,well there you are.. Better than a sharp stick...