I saw a whole video on bear attacks once, strangely enough. The wisdom was that with black bears waving your arms was supposed to encourage it to go away. With a grizzly bear the advice was to play dead as if your life depended on it. But there was still the understanding that this was in a situation where a confrontation was inevitable--such as coming upon a mother with cubs. Climbing trees was also a good idea rather than trying to outrun flat out. If you had a chance to just back away and have the bear do that too, obviously that's the best scenario.