In most cases, the best thing to do after encountering a bear in the wild is to back away slowly while talking in a calm yet firm voice. In a developed area like a backyard or campground, the bear can usually be frightened away by loud noises. On public land, notify the park rangers if a bear enters a developed site.
During a bear encounter, move slowly and avoid running or making sudden movements. Either action may provoke an attack. Bears can run approximately twice as fast as humans and are capable of running downhill, despite a common myth saying otherwise.
Some bears, especially older juveniles or young adults, may follow people out of curiosity. These bears are generally not a threat and can be frightened off by assuming an aggressive posture and shouting. However, this should never be done if the bear is a mother with cubs nearby or if there is an animal carcass or other food around, because the bear might perceive the action as a threat and may attack in response.
Carrying pepper spray designed for use on bears is often recommended for hikers or campers, especially in areas with large bear populations. Pepper spray should be used as a last resort if methods to avoid contact fail. One of the best safety practices in bear country is to wear bells or otherwise make noise while hiking in order to give bears warning, since many attacks happen when bears are startled. Bears generally want to avoid conflict with humans.