In my experience backpacking in griz and black bear territory, food hygiene is by far the most important factor in avoiding a bear encounter. One reason I like camping in the backcountry, away from group campgrounds, is that it reduces the probability that I'll be a victim of someone else's bad food hygiene attracting a bear to my vicinity.
A recent attack in Yellowstone demonstrates that a group campground is not necessarily protection against a bear attack (although it does help with immediate aid):
http://www.bozemandailychronicle.com/ne ... 002e0.htmlA couple weeks ago I did an overnight near that area (Lamar River, great cutthroat fishing) and hikers coming back on the trail were telling stories of a griz repeatedly coming back to a campsite with a designated bear hang, despite the apparent lack of food at the site. Even bad food hygiene in the recent past can bring hungry bears around.
I use this system to hang my food:
http://www.backpackinglight.com/cgi-bin ... ystem.htmlIt includes an O.P. Sack, which completely blocks all food odors. It works. One morning while packing up camp in Wyoming, I had a young black bear show up and walk right by my filled O.P. Sack on the ground, unaware of the food a couple feet away from him. Rodents ignore the bag as well, even if it's left on the ground all night. Highly recommended. I like to pack one day's worth of food each in small O.P. Sacks, and put them all in a big O.P. Sack.
I also carry bear spray, on my belt when hiking out in the open, and in my hand when I can't see at least 100' in all directions. I sleep with my can of bear spray always in the same location near my right hand. I practice drawing it every morning. I'm a decent shot with my .44 revolver, but I rarely take it with me anymore, as I've become convinced through research that bear spray has a much better success rate. You can't miss with bear spray, and it almost always ends the attack. In contrast, you'll likely miss a charging bear with a handgun, and even if you get a direct hit, the animal is still likely to continue the attack (a bear can keep attacking even after its heart has stopped).
But I'd guess that food hygiene is 90% of bear defense. It's all about the food.