I used to see bears often. One of my closest encounters was while out on a trail run.
I was on a switchback portion of the mountain and mainly looking at the ground in front of me as I ran. I noticed something and looked up, 10 feet in front of me on the trail was a bear, I literally almost ran into her.
I slowly backed up and just waited. She went up the hill to the next portion of the switchback before finally getting away from the trail.