In Alaska they can positively ID Grizzly scat on the trail because it has those little bells buried in it.

These pepper canisters designed for Grizzlies are very large and heavy like a small fire extinguisher. I bought one and carried it day hiking in Yellowstone/Tetons with small kids. We saw a few Grizzlies at safe distance, exciting and no problems. For black bears I carry a tiny canister of pepper for self defense that would probably work on a bear at close range. The numbers show a much great risk from a human nut job than a bear. I've encountered lots of bears in the Sierra and never felt a need to spray them. The Rangers at Yosemite have been hazing the bears there with fireworks and other means for years. Together with more bear boxes, the incidents have dropped dramatically.

The only time I felt really worried about a black bear was when we hiked by a little cub next to the trail at Hetch Hetchy and we didn't see Mama bear around. My little kids wanted to pet it but I got them out of there pronto. Except for protecting baby cubs, all they want is your food. Do not let them get it or your trash. Period. If they have outsmarted you out of your food, just remember, it is now THEIR food and you are the thief. That's how people get hurt.

The foolproof solution: hike with a fool you can outrun. :o