A bear isn't going to be looking at you as food. It will however look at you as a food "source" as in having something it might eat, but it won't bother you too much unless it smells chow somewhere around you. Bears don't like to be bothered much.
However.........................
Piss one off by hurting it or by getting too close to a momma bear's cubs, and you are in for a world of hurt. Momma bears will defend their cubs no matter what, willing to die for them if that is what it takes. Hurt one? They are going to be looking for revenge and want to make you hurt at least as much as you hurt them.
If they come at you and you hit 'em with bear spray? That's a minor irritation that doesn't hurt much (kinda like getting stung by a bunch of bees), and they will look elsewhere for a snack. Also, because you didn't hurt them, they don't really see a need to go through all the effort of hurting you.