You need some advance warning, no matter what defensive methods you're using. A good dog might do the trick. When I'm out walking with my Sheltie he senses anything that comes within a hundred feet.
If you're headed to bear country you better bring a back-up Sheltie. Or two or three.
In the Gravellies that's called bait.