Though attacks are rare, always practice bear safety while adventuring outdoors.
Here are some useful tips to practice bear safety from the National Park Service.
Identify yourself by speaking in a low-tone voice—screams or high-pitched voices may make the bear thinnk its the sound of 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.
Make yourselves look as large as possible (for example, move to higher ground).
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. Bears can run as fast as a racehorse both uphill and down. Like dogs, they will chase fleeing animals.
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.