I saw movement with my peripheral vision, saw the bear, and almost crapped my pants. I looked around for cubs (so I didn’t inadvertently move closer to them), picked up a nice thick stick in my right hand, took hold of pepper spray in my left, then raised my arms and yelled at it moving slowly forward. It turned around and loped away.
I wasn’t being brave, but knew that I had to keep it away; I was a couple of miles from help, nowhere near marked trails, and couldn’t have it follow me. Last fall in northern NJ a college student was killed by a black bear; it had been following a couple of hikers, who warned a group of five students about it. They ignored the advice to turn back, and ended up running into it. They scattered, and it killed one of them. I think if the pair of hikers that had originally encountered it had scared it (instead of piquing its curiosity), that might have ended differently.
I had to convinve the bear that I wanted to eat its heart for lunch; inside I was terrified. The best way to describe it was that I could “hear my heart pounding”...
That's reminiscent of the old joke ending "I don't have to outrun the bear; I just have to outrun YOU!"