Yosemite bears are after your food, and they are getting smarter every generation. Thankfully, there is almost no risk of injury from a bear (the only death in Yosemite caused by wildlife that I am aware of was caused by a deer), but the wrong kind of bear encounter can certainly end or delay your hike.
In the past few years the park service has observed bear behavior that has changed some of their recommendations regarding how to use your bear canister.
First, bears can differentiate an open canister from a closed one, and are willing to “attack” the canister with some enthusiasm. The worst area for this kind of activity is Little Yosemite Valley, where several hikers have lost food when they left their canisters unlocked while they cooked. I try to be a good steward of the wilderness when I hike, but I have to admit there have been times when I’ve walked away from an open canister. The solution is simple: only have your canister open when you are pulling stuff out or putting things in. (If you carry a Bearikade, like I do, this is a bit of hassle because it isn’t the easiest to get open and closed, especially in the cold. Bite the bullet and secure the latches — all three of them!)
Second, at least one bear in Yosemite has learned that if you roll a secure canister off a high enough cliff, a piñata-like surprise will await below. The park service is now recommending that when you situate your canister for the night it be put “in an area that is difficult for a bear to roll or bat it away and within viewing distance of your camping area.” They also suggest you place “noisy objects on top of your canister to help alert you if an animal is attempting to move it.” They propose using a cook pot.
The park service is less forthcoming on what you should do if the bear shows up and makes enough noise to wake you. I might do some yelling and throw some small rocks, but I’m not about to get into a wrestling match with a hungry ursine over a Mountain House meal (well, unless it’s the fettuccine alfredo). I have had a bear attempt to get into a canister while I slept, but I had placed it in a depression surrounded by boulders and smaller rocks, and it lost interest pretty quickly. (It was almost empty, and it sounded like a toddler banging on a snare-drum.)
I have no data to back this up, but I suspect that about a third to half of all thru-hikers will see a bear somewhere on the JMT, and that most of those encounters will take place within Yosemite National Park. Counterintuitively, the less wild the area, the more likely you will spot a bear. The best way to take care of them — and you — is to make sure your food, and your canister, is properly stored.
Good hiking, Ray