Experiencing the natural world can sometimes seem frightening, largely it is our own minds that make it so but anyone intelligent who has encountered a grizzly bear or a mad mother moose in the wild would hopefully agree that it can be dangerous. I encounter many bears in my trekking and have only had to act adversely with two story here second story not yet written. Bears in the wilderness are much less accustomed to humans, they do not seem to like being around them (and I don't blame them). If they ever catch my scent or hear me, the gig is up and I probably won't see that bear again that day (in my experience bears take it personally if you "stalk" them, i.e. following them is a bad idea). If you do not want see a bear, I realize not everyone shares my appreciation or inspiration, the best advice I can give is talk loudly or sing, the human voice to bears is like garlic to vampires. Bells are generally not a good idea, they could sound like a marmot (tasty morsels for bears) or something else that encourages curiosity.
Bears (and other animals) know what trails are used by humans a lot, and when. They use them more at certain times, early in the morning or later in the evening. If you are going to leave the trail you must pay extra attention, I have had many great experiences that if I had not been so aware of my surroundings, could have turned out very badly indeed. A lot of times when we start to get tired, on the way out after a long hike for instance, we stop paying as much attention to our environment. This seems to be the cause of many bad situations for people. The animals themselves really do a lot to help out unaware people, but it always pays to increase your luck anyway that you can. In Glacier Park I once spotted a grizzly with two cubs from about four miles away with my spotting scope, they were traversing a mountain side, the bears stopped, went straight up the mountain about 30 or 40 yards, and laid behind some bushes. Less than 5 minutes passed before I saw a pair of hikers walking on the same path downhill from the bears without a pause. After the humans had passed the bears came back down onto the trail.
First, are you sure they know your there? Chances are if you are upwind than a bear (most wildlife) knows your there and what and how much you ate at your last meal. Just because they are not looking at you does not mean they don't "see" you.
If you are sure they know you'r there and are not moving away from you it is important to determine where the encounter is headed. Contrary to popular belief wild animals are quite predictable if you know what your looking at. For example if a bear knows your there and keeps feeding or carrying about his business than he is tolerating your presence. These are the absolute best situations for experiencing wildlife. These animals are USUALLY human habituated, which means they are around people so much that they are willing to tolerate our presence a lot more. This does not make you safe, there is always a personal space that once crossed changes behavior. Also they can always change there mind or have a bad day.
On the other hand the animal knows your there and does not ignore you. A few rare case examples;
If an animal that absolutely does not see you as food (moose for instance) is approaching you, speak, if they know your a human and keep coming get out of there way. If a moose or an elk is coming after you they are NEVER bluffing. If you get knocked down, stay down. Bear spray may be useful in some of these situations but I have found that they give you plenty of time to retreat.
OR
Your hiking along and come over a hill or around a corner and there is a grizzly sow with cubs. She spots you at about the same time and charges. Don't run, step back slowly or stand your ground while waiving your arms slowly and speaking calmly. This is almost always a bluff charge, and provided you remain non threatening and the bear hears that you are calm she will collect her kids and put some distance between you. If a defensive bear (bear with cubs or a surprised bear) makes contact with you, go down and stay down until you are sure they are gone. These types of situations can be avoided by paying close attention to your surroundings and making noise when you can't see.
A bear notices you, perhaps at fairly close range, lets say 75 meters and begins to approach. It is important to make sure he knows your a human, wave your arms slowly above your head and speak in a calm voice. If he knows your a human and keeps coming anyway ready your deterrent and speak more firmly or even shout. If the bear approaches close enough for the bear spray use it. Anytime the bear stops or appears to be considering options see if you can gain some distance away from the bear. Never run! Bears can run faster than any person UP or DOWN mountains. This would probably be a territorial situation. If you think it is a predatory situation you need to be as aggressive and mean as possible. If a predatory bear comes into contact with you fight for your life. I spend many, many hours looking for and viewing bears, I have never had to use my bear spray, I have only taken it out of the holster twice. Once with a black bear and once with a grizzly. Both appeared to be seriously considering me, how I acted determined the outcome of these situations. In both cases it was critical to remain cool and calm, I was rewarded with priceless memories.
Check:
1.)Does the animal know I'm here and that I'm a human?
2.)Is the animal acting defensively (young, territory or fear for self)? Or in some other way.
3.)Does the animal eat meat?
The posture and behavior of this sow sent a clear, easy to read message; don't come any closer.