I have studied online sites for best practices and this is the drill i practice when I am on the trail (meaning, i mentally walk through my drills to ensure at game time,...it is automatic)

1.  Be cool.   Don't run.  Don't yell.   You have about 1-2 seconds to give yourself a shot.  

2.  Don't stare the bear down.  In bear country, staring means, "Please eat my face".

3. If the bear is already upon you.  Go into the fetus position.  Keep your backpack on.  Your pack may cover the back of your neck and your entire torso.  If not, use your hands to cover the back of your neck.   The bear may strike you several times, but remain curled and let the back pack take the majority of the blunt force.  

4.  Your life depends on not freaking out.  If you freak out and act as prey...the battery will continue.  If this is a black bear and the aggression continues, you need to fight back.  Kick, scream, claw, and make that bear know you are NOT prey.  If it is a brown bear, it is typically going to be so BIG you can't really fight back much.  Stay curled.

5. Stay cool.  Freaking out makes blood pump faster and you will bleed out. 

6.  Take any cloth you have and put compression on your wounds.  Move.   If you have multiple wounds, use duck tape.  MOVE.  You need to get out of the blood zone.   The smell will attract everything out there.

7.  Get back on the trail and head to safety.

8.  Never look at your wounds or dwell upon lost flesh/limbs.  This makes you sad.  YOU need positive endorphins running through your body right now.  Your positive thoughts and your planning will give you a chance. 

9.   If you start getting really cold.  You are bleeding out and you will pass out soon.   You need to secure your bandages.   Put on extra clothing.  Drink some water.   Find some type of shelter in plain view of the trail.   If you have any energy left, use your whistle, signaling mirror, or create a quick smoke signal with your kindling kit.  You need to give yourself a shot to be found.  If there is too much blood, you need to cover that scent.  Defecate, and wipe all over your body.  Animals don't like eating dead poo.

10.  ***backpacking alone is NEVER advised.