While nobody is 100% safe in bear country there are a number of proactive ways to stay safer. Educating yourself so you have a general understanding of basic bear behavior is critical. There's no such thing as typical bear behavior so it's vitally important to know what can go wrong, have a working knowledge of deterrents and be prepared for any scenario before you step into a bear's world.
B E A R D E T E R R A N T S
The more we learn about bears, the more we find that a gun is not necessarily the first-best line of defense in the event of a close encounter gone bad. If you carry a gun it must be a high calibur and aimed precisely to effectively stop the bear. That's not an easy thing to do when a bear charges or you are under attack. A bear's skull is made of thick, dense bone and only a high calibur gun can penetrate it. You can try aiming for the heart which would be nearly impossible during an attack scenario. Bear spray has been proven to be a much better deterrant to an attack than a gun.
Shooting and killing a sow who is instinctively defending her young cubs may result in all of her cubs dying too. Rules and regulations regarding shooting a bear varies from state to state.
Some bears are illegal to shoot at any time because they are on the Endangered Species list. For an official list of endangered wildlife searchable by state and species visit: U.S. Fish & Wildlife Service.
Pepper spray (a.k.a. "bear spray") on the other hand can be used on a charging bear at distances up to 40 feet - downwind of course - and will stop most bears in their tracks giving you time to get away to safety. The obvious benefit is that the bear is stopped instantly and is not permanently harmed. The effects will wear off in time and the bear (and you!) can get on with life. The sprayed bear learns to associate people with the painful sting of pepper spray.
UDAP Bear Pepper Spray
I carry both a firearm and UDAP UDAP Bear Pepper Spray. Bear Spray was invented by Mark Matheny after a friend saved his life during a bear attack by using a small can of mace. I must warn you that some of the photos of his attack are on the first pages of his website and pretty gruesome - not for the faint of heart. You can find his product for a little less on Amazon or in most hunting and fishing shops. It can be as much as double the cost in sporting goods stores nearest popular hunting areas.
It's a good idea to read all of the manufacturer's instructions and to practice using the spray before entering bear country. Find a safe place away from people, pets and structures and unless you want a face full of mace, by all means spray downwind! Practice holstering and unholstering the can until it becomes automatic. The holster can grip pretty tightly when it's new. Be sure that everyone hiking with you also has some form of protection. Even a small can of pepper spray is better than nothing, but at least one or more adults should carry pepper spray at all times.
There are several kinds of portable battery operated fences that are proven effective against bears and other critters in the backcountry. Most protect about 20 square feet and the battery will last up to two weeks. The newer ones are lightweight and can be carried fairly easily. It's a great idea to have one anytime you are camping in bear country or even stopping for a picnic lunch where bears frequent.
If you are the resourceful type, eHow has detailed instructions and videos showing how to build your own electric fence. Pre-manufactured ones are probably best for backpacking and camping applications.
FOOD COOKING AND STORAGE
In many bear country campsites there are bear lockers for safely storing food. When bear lockers are not available it's important to know if bear canisters are available for rent or if you'll be required to bring your own bear-safe storage. More and more camping areas and parks are requiring the use of bear proof cannisters. I've also heard that some ranger stations will let campers and hikers borrow them for free (though a small donation is always nice!). Check with the ranger station to see if there is bear activity in the area you plan to be - even if there hasn't been recently it doesn't mean you're not going to encounter a bear.
REI has an informative article worth reviewing called: Reasons for Using Bear-Resistant Canisters.
Anything with a scent - including many "unscented" products should be stowed in bear proof cannisters or bear lockers at campsites (where provided). Keep anything that might smell like food to a bear away from your tent and your campsite. If you must leave your cooler in your vehicle, cover it with a blanket or stow it in the trunk.
Typical camping items that may attract bears and other wild animals may be surprising.
Wash used dishes away from camp and don't think that burning the food scraps will erase the scent. Before you pack your food into a bear cannister repack the food in airtight plastic bags to help reduce the food's scent. The same goes for backpacks.
B E A R S H A V E B O U N D A R I E S
Unlike wolves and many other wild animals - and contrary to popular belief - more recent research shows that bears are not territorial, rather they have personal boundaries that differ from bear to bear. Black bears tend to avoid contact with people unless there is food involved or they have become people conditioned. They prefer more densely forested areas whereas grizzlies are used to more wide-open spaces and known to be more aggressive when startled, defending cubs, guarding a carcass or when you've entered their personal space.
Always keep a safe distance from bears
If a bear stops what he or she is doing to notice you, you are too close and run a much higher risk of attack. Back away and retreat the way you came, never run except in extremely rare cases when you are absolutely certain you can reach shelter before the bear reaches you.
H I K I N G & C A M P I N G
When hiking in groups with children or smaller adults, always keep the kids in the middle, never out in front or holding up the rear of the group. I've heard it described as a "family sandwich" with the parents as the bread. Several sources claim that an adult whistling or a young children's squeals sound a lot like an injured animal or prey to some predatory animals.
KEEPING KIDS SAFER: PLAN AHEAD
Before you get to camp or the trailhead teach your kids how to be safe and enforce the rule that they always stay on trails and in between the adults. Last year for Christmas I gave my young neice and nephew a book called Who Pooped in the Park (there are different versions for various parks). While on our Montana property we were able to identify some of the animal scat and making a game of it created an opportunity to educate them to be aware of what's around them.
Always sleep in the center of your tent and stow gear on the outer edges
Bears typically sniff, paw then sometimes bite to see if something new in their environment might be food. Better the bear bites your gear than your rear! In all seriousness, the more time you have to avert an attack the better. Some people leave ropes with bells tied around their campsites. I prefer using electric fences which have been shown to be excellent in discouraging many kinds of wildlife including curious bears.