Most animals don't attack humans. We're not their natural food source. Most attack humans because they're starving or startled. If attacked, sometimes it's good to run as fast as you can, hoping they can't catch you. Other times, it's sensible to play dead. But, at the end of the day, it's better not to be in the situation in the first place.
Brown Bears, or Grizzly Bears.
With a Grizzly, stand as tall as you can and raise your arms above your head. Especially if they have a gun. "I give up, don't shoot me." Whilst still looking big, back away slowly, without making eye-contact. This will be seen as a challenge, and they are likely to slam-dunk your butt into the ground if they think they're being challenged.
If the bear follows you, panic! You're going to die. Nah, only kidding. Although I'm not. Stop and stand your ground. At this point, they may make a charge. Again, stand your ground. It's probably a fake just to test you. If it isn't, you're going to die. Nah, only kidding. Although I'm not.
If all this fails, fight back. At this stage you've nothing to lose. Throw rocks, punch its nose, kick it in the nuts, throw a few well placed insults. Anything.
Black Bears are smaller than the Brown Bear
If a Polar Bear attacks, then you've basically had it