Bear spray will deter 99.9% of bear attacks, carry something bigger than .45 for grizzly.
Make sure you eat away from camp and store your food away from camp too. Im of the opinion that a determined bear can get your sack and canister no matter how you hang it and that its there so that your food is just stored away from your tent. If you hear something fucking with it you can just go out and scare it off. Bear bells are annoying but do work quite well as a repellent.
as
>>1882093 said im more worried about getting attacked by some trail methhead than a bear. Some hobos target trails because there are a bunch of yuppies with 3k worth of shit walking around miles from any real help.