What to do if you encounter a bear
Okay, you're strolling along, living your dream on the trail, and you spot a bear. This is an epic, awesome honor and privilege. You're getting to be a part of the wild wonder of nature. Then it suddenly turns less epic and more scary as the bear has also spotted you. Now what?

Don't run - This request is easier said than done, but is an important one. Bears, like dogs, will pursue and give chase to fleeing animals. Bears can run just as fast as a racehorse up and down hill, so the odds of you successfully out running one is not in your favor. You ain't an Olympic runner baby, don't risk it.
Identify yourself - Talking calmly so the bear knows you are a human and not a prey animal. Remain still; stand your ground, but slowly wave your arms. Help the bear recognize you as a human. It may come closer or stand on its hind legs to get a better look or smell. A standing bear is usually curious, not threatening.
Stay calm - Bears may bluff their way out of an encounter by charging and then turning away at the last second. Bears may also react defensively by woofing, yawning, salivating, growling, snapping their jaws, and laying their ears back. Continue to talk to the bear in low tones; this will help you stay calmer, and it won't be threatening to the bear. A scream or sudden movement may trigger an attack. Never imitate bear sounds or make a high-pitched squeal.
Pick up small children and small pets immediately.
Get your dog under control - don't allow your dog to be loose on the trail.
Make yourselves look as large as possible - For example, move to higher ground.
Do NOT allow the bear access to your food - Getting your food will only encourage the bear and make the problem worse for others.
Do NOT drop your pack - Your pack can provide protection for your back and prevent a bear from accessing your food.
If the bear is stationary, move away slowly and sideways; this allows you to keep an eye on the bear and avoid tripping. Moving sideways is also non-threatening to bears. Do NOT run, but if the bear follows, stop and hold your ground.
Do NOT climb a tree - Both grizzlies and black bears can climb trees.
Leave the area or take a detour - If this is impossible, wait until the bear moves away. Always leave the bear an escape route.
Be especially cautious if you see a female with cubs - Never place yourself between a mother and her cub, and never attempt to approach them. The chances of an attack escalate greatly if she perceives you as a danger to her cubs.

BEAR ATTACK!
So you did everything to deescalate the situation, but the bear is now attacking you! Now what do you do? This one really depends on the kind of bear.
Brown/Grizzly Bears: If you are attacked by a brown/grizzly bear, leave your pack on and PLAY DEAD. Lay flat on your stomach with your hands clasped behind your neck. Spread your legs to make it harder for the bear to turn you over. Remain still until the bear leaves the area. Fighting back usually increases the intensity of such attacks. However, if the attack persists, fight back vigorously. Use whatever you have at hand to hit the bear in the face.
Black Bears: If you are attacked by a black bear, DO NOT PLAY DEAD. Try to escape to a secure place such as a car or building. If escape is not possible, try to fight back using any object available. Concentrate your kicks and blows on the bear's face and muzzle.
If any bear attacks you in your tent, or stalks you and then attacks, do NOT play dead - fight back! This kind of attack is very rare, but can be serious because it often means the bear is looking for food and sees you as prey.
Don't be totally enchanted by the cuteness - bears are wild animals, remember that!

Avoiding the whole encounter
While hiking or camping, making noise can be your best defense in preventing a bear encounter. Bears, for the most part, like to keep to themselves; making noise while you hike along gives the bears a heads up that you're coming through. This also provides them plenty of opportunity to move along. This, more importantly, prevents you from startling a mother bear which is definitely a no win for you.
The next important thing you can do to prevent an encounter is properly securing your smellables. Don't leave food lying around or in your tent or even in your pocket. I once heard a story about a hiker getting attacked on the Appalachian Trail because the individual had chap-stick in their pocket. This is often times why backpackers don't bother with deodorant and fresh smelling scents, this, and of course, the additional weight to carry. Even some bug repellents are discouraged based on the citrus scent.
I had my own encounter with a bear on the AT and let me just tell you, you don't have to have a bear standing on its hind legs in front of you to get the memo. Their roar is quite formidable. It is an unforgettable experience for sure.
BEAR SPRAY - On my hikes along the AT, I have never once carried bear spray nor a gun. I did, however, carry mace, because people are cray. Yet, after my bear encounter I had started to question that decision. It is pretty common practice to not carry bear spray when doing long backpacking trips, because managing the weight of your pack is such a high priority. Out of all my hundreds of miles on the AT, only once did I encounter a bear. Often times hikers start to weigh the odds of an encounter vs the frustration of carrying what is believed to be dead weight. I say carry exactly what you need to feel comfortable and protected. If carrying bear spray gives you the courage and security you need to go out and enjoy nature and its awesome wonder, then carry it. Because at the end of the day, it's that 1 in a million that counts, isn't it.
Bears are amazing and beautiful, like all animals they deserve our respect and space. I mean, let's be honest, at times we can hardly tolerate our own families and co-workers. It's annoying to have people constantly intruding in on your boundaries, isn't it? So, let's give wild life the same respect. BEAR in mind (see what I did there?) that if you venture too close to a wild animal and they do what wild animals do, they will most likely pay for that their lives. So, don't be that person who gets too close for a silly selfie. Don't be that person who feeds the animals. While I truly understand the temptation for both, ultimately you put other people and the animals in danger. So, if you want to be careless with your own life, go do it somewhere else in some other way. I'd rather you get a safe picture from a distance and come home with a cool story to tell.
Important note: The information provided in this post has come from various sources, both professional and my own personal knowledge and experience. This includes books, national park websites, Youtube videos, wild life and game management resources, pamphlets, etc. All of which pretty much say the same thing in varying degrees. It is important to know that nothing is a 100% guarantee. Wild animals are just that, wild animals, which always leaves room for unpredictability.
As always, keep it safe, keep it cool, and stay curious.
