The risk of bear (e.g. grizzly) encounters are serious while riding the Continental Divide Trail. While on that ride, I'd suggest keeping a whistle tied around your neck through ALL of the Northern Rockies. Blow real hard and say your prayers if you have an encounter with one and are actually danger. Skip the bear spray (it won't stop one) and the gun (you won't react in time). That's just my own advise and opinion for the Continental Divide Trail, of course.
I think that the risk of encountering them while riding the TransAm, on the other hand, is very low, unless you're camping in some serious off-route backcountry. While riding the TransAm through the Northern Rockies, it's plainly obvious where bears will be a threat. You'll see bear-proof dumpsters and garbage cans lining those portions of the route. Bear-boxes, in which to store your food at night, are omnipresent at campgrounds in that region.
Appalachia does have black bears and they're known to be a nuisance, but they are not a threat. In the event of a middle-of-the-night campsite encounter with a black bear, the only real threat they pose to you is when they tear your gear apart and ruin it in order to get to your food. Mice, of course, can do the same kind of damage.
While riding the TransAm, the only precautions I took when in bear country were the obvious ones: use the bear boxes available and, when they're not available, don't sleep with any food. While it is sage advice that you should do your cooking, eating, washing, and storage of anything and everything that might be food-related (including the clothing you wore while cooking your food) at a soccer field's distance from where you sleep, it is advise that is complete overkill (no pun intended) for 98% of the campgrounds in the Northern Rockies. The ubiquitous food-stocked RVs, which turn many of the Northern Rockies campgrounds into 'Walt Disney World Goes Camping', should provide a bit of perspective on this.
When I wasn't in bear country, I took precautions to keep the mice at bay in the event of them wanting some of my food. Their threat is completely underrated, in my opinion. No, they won't kill you. But on the other hand, they can chew holes in your expensive gear (good-bye waterproof capabilities). To prevent this from happening, I'd keep my food, toothpaste, and soap in a bag that I could afford to lose. This bag would stay with me under my tarp/tent, coddled in my arms and at the ready for my insatiable midnight snacking (soap and toothpaste excluded), or in any other convenient spot, so long as something expensive couldn't get chewed through if one of those miniature-grizzlies waltzed onto the scene.
In summary, I skipped the bear-bagging, bear spray, whistle, and 357 magnum while riding the TransAm. I'm comfortable with the choice I made and would do it the same way again. The less weight, the better!