I have seen brown bears in person in Yosemite National Park and also the Smoky Mountains. Despite the massive amount of calories a bear needs to consume daily they generally do not attack and eat humans and instead eat grubworms and such in tree trunks. (sounds inefficient to me)
The biggest reason they would attack humans is if you get between the mother and her cubs. But if they get hooked on human food they will search it out and thus get closer to humans.
Also bringing a gun would not necessarily save you. On other bear episode of I Shouldn't Be Alive a hunter was mauled by a bear and he was able to kill it in one shot which the narrator said is almost impossible. This hunter was lost from his hunting party and after having his leg mauled he had to stumble down the mountain side.
I have learned you have to stand your ground, flare your arms to appear larger and get the bear to back off, never turn your back to them.