I doubt theres a "right" thing to do when being attacked by a bear. In this case, with this bear, he actually drove it off and survived.
The advise is always to "play dead" but theres an awful lot of people that have tried that and been eaten alive. Theres a young lady up in Fairbanks named Cynthia Dusel-Bacon that played dead while a bear ate her breasts, forearms, buttocks and much of her upper legs. Somebody with a gun showed up and drove it off. Can you imagine? She was conscious through all of that and playing dead.
Words fail me, carry a gun in bear country.
The Bears and Bear Maulings Page: members.xoom.com/keithrogan