I think it depends on the bear. Where I live it is black bear and supposedly they will take advantage of leaving if given the opportunity. That is the kind I ran into, it was eating beside the trail. When I made some noise, he looked at me and ran. When I lived in Colorado, I used to mountain bike in the back country. There were always mountain lion warnings and tips on what to do if confronted by one. I have heard of when the tips worked and when they didn't. One time, some dumb people let their 3 year old walk far enough ahead of them that they couldn't see him on the trail while carrying a bag of granola. It didn't end well. The girls in Alaska said that whistling sounds like marmots, which are tasty for bears...
we visited Whistler, in BC--i think it was named after the marmots. plenty of bears around there, too, although i was glad not to encounter any.
the thing to get would be a fishing pole from which to dangle a whistling marmot, far out in front of you. then the bear would attack the marmot, instead of the hiker.
or, maybe i could get some of those whistling footballs. when the bear attacked, i could throw the football over the bear's head, and he would turn around and chase the football. that should work!
what did they suggest to do if confronted by a mountain lion? other than beating at it with a stick (or, if you're a hunter, shooting it), i'm not sure what your're supposed to do.
when we visited vancouver island, several years ago, the ml's were attacking people in the towns.
a canadian told us that the canadian govt had re-located ml's to vancouver island, but there wasn't enough food for them there, so the ml's began to prey on people!