I want to add a couple of comments about bear spray. I've spent a lot of time in both black and brown bear country (or grizzly country if you're 50 miles or more from the coast), and I've always carried bear spray. Sometimes I've been in very remote areas that were very heavily populated with bears. One thing I did very early on was invest in a canister of bear repellent for the specific purpose of testing it. My rationale for this was that if I ever made the decision to discharge my bear spray in the backcountry, I wanted to be confident that I had first had some experience using it in a non-life threatening situation.
For my "target practice" I tied a bandana onto a tree branch, trying to simulate the approximate height of the head of a charging brown bear. I was about 15 feet from the tree when I started spraying. There was a very light breeze blowing (as there may be in real-life conditions), and I was shocked at how quickly the breeze carried the spray away. I adjusted my aim to account for the breeze (and sprayed in a slight fog pattern), and then some of the spray reached the target. What I learned from this practice session is that you absolutely have to resist the urge to fire the bear spray too soon. This is a good idea anyway (as a previous post mentioned), because the last thing you want to do is turn a bluff charge into a real one. I also learned that a slight breeze will make it very difficult to aim the spray. One obvious thing is to hold your breath for as long as you can to keep from inhaling the spray. I was wearing sunglasses, but some of the spray still got into my eyes through the sides. I was able to see, but it was very painful.
When I'm backpacking (or kayaking) in bear country, my bear spray is carried in a holster where I can get to it right away. This stays with me while setting up camp and cooking, and it's in my tent when I'm sleeping. During kayaking expeditions I've spent several nights at beach campsites when we saw the bears on the beach, but we landed and camped there anyway. It was that or face an angry sea (or unfriendly currents) after dark. Between those two dangers, I'll take my chances with bears any day.
On one of those occasions I was setting up my sleeping quarters when a large boar started coming downhill straight toward me. I stood my ground and took out my bear spray, and the bear just kept coming. When he was way too close for comfort (but too far away to use bear spray), I very calmly took one step back to signify that I was not a threat, then I stood my ground again. This may be a controversial action, but the big guy immediately turned sideways and went on his way. I've read all of the suggestions about how to behave during bear encounters, and I always cook and store food away from camp. When I'm out there and encounter a bear, I stay calm and trust my instincts. So far that has worked for me.
On one occasion, while stopped for a quick break on a beach, a young brown bear walked onto the beach and went after my kayak. When he contented himself with pulling on my bow line, we just watched and left him alone. But when he ripped my sea sock out of the cockpit and started to get into my kayak, one of the members of my party suggested that we intervene, and he started advancing immediately. We all followed. We were a party of 4, and 2 of us had our bear spray in our hands. We held our hands (except for the hands holding bear spray) high in the air, talked to the bear in calm, but firm voices, and advanced very slowly, staying very close together so that we would be perceived as larger. The young bear dropped my sea sock, backed up, looked at us, then walked away. The only damage to my sea sock was a lot of bear slobber.