While backpacking in my backyard here in Oregon and Washington I've had encounters with black bears and in all but one of these situations the bear has turned and run away. Although, while backpacking solo on Mt. St. Helens I encountered a rather large black bear who engaged in a "stare down" with me. He didn't move but just stared at me. He saw me before I saw him. I was high on the mountain in an open meadow and he was no more than 50 yards away. I was absolutley petrified, but remained still, stared back, and after what seemed to be an eternity he lumbared off. I still had a couple of nights to go before I was done with my trip and let's just say I didn't sleep well after this encounter.
However, I've spent a lot of time in bear country and I always hang my food if there is not a bear locker available. I also cook at least 25 yards away from where I am going to sleep. Also, the advice of keeping your cooking utensils, toilitries, etc, away from where you sleep is also sound advice.
Last summer I went on a solo motorcycle trip through Glacier, Yellowstone, and the Grand Tetons and camped the entire trip and had no problems following those rules.