Rule No. 1 when you're hiking in bear country: make noise. Most bear attacks occur when hikers stumble upon and surprise a bear, often a mother and her cubs. Don't think they'll be easy to spot; even huge grizzlies can conceal themselves in the brush or the high grass of meadows.
If you see a bear, fight the urge to run. Repeat after me: You can't outrun a bear. Bears can sprint for short distances at speeds up to 35 mph! And don't assume you can escape by climbing a tree. That only works if you have enough time to climb at least 30 feet high. Black bears are good climbers and grizzlies can climb at least partway up a tree. And if you're near water, e.g., a lake or river, don't get in the water and try to swim away from the bear. They can swim.
OFFER SOOTHING WORDS
What you need to do is stay calm and slowly begin backing away. If you are downwind and the bear hasn't seen you, try to make as little noise as possible as you slowly backtrack. If the bear sees you, however, you also should start talking to the bear in a calm, firm voice. That will allow him or her to identify you as a human. And try not to stare into the bear's eyes. The bear may interpret direct eye contact as aggressive behavior; it's better to avert your eyes and turn your head to the side, a more submissive pose. As you move away, it's not a bad idea to stay upwind of the bear, if possible — you want him to know you're a human.
If you're in a group, stay together. You'll look larger and that could keep the bear from charging.
Often bears will bluff a charge, meaning they will rush toward you and then stop in close proximity to your position. It's a warning to back off. Heed the warning. Back off. Slowly. But should the worst happen and the bear attacks, reach for your bear pepper spray. If you carry bear pepper spray, make sure it is easy to reach — it won't do you much good in your backpack, so keep it close to your hands.
DUCK AND COVER
Sometimes just the sound of the spray discharge will stop a charging bear. But if the bear keeps coming, as a last resort, drop to the ground and play dead. Either lie on your stomach with your hands protecting your neck, or lie on your side in a fetal position with your legs and head tucked into your chest. And keep your backpack on. It can serve as a shield. Basically, you want to protect your soft tissue and organs to the best of your ability against a large animal that is built to maul.
Finally, don't move or get up until you're certain the bear has moved a distance away. There's a story of one hiker who made the mistake of reaching for his bear spray while the animal was nearby, an action that provoked another attack.
One last bit of advice if you plan to camp in bear country. Most people know to keep their food either in the trunk of their vehicles or in an approved bearproof container. Many campsites, even in the backcountry of some national parks, have bearproof storage lockers or bear poles. If unavailable, hang a ""bear bag"" at least 200 feet from your campsite. A bear bag is a stuff sack loaded with your provisions, cooking gear and the clothing that you wore while cooking, which you suspend from a sturdy tree branch at least 10 feet above the ground and 5 to 8 feet from the tree trunk. Make sure you store your cooking clothes in the bear bag, because sleeping in the same clothes you cooked in is like yelling, ""Come and get it!""