What you should do in a bear attack largely depends on the bear's behaviour, not the species of the bear. The old saying "if it's brown lie down, if it's black fight back, and if it's white say goodnight" is largely outdated based on what we know about bear behaviour but is still used by certain agencies. The National Parks Service still provides advice based on species stating:
Brown/Grizzly Bears: If you are attacked by a brown/grizzly bear, leave your pack on and PLAY DEAD. Lay flat on your stomach with your hands clasped behind your neck. Spread your legs to make it harder for the bear to turn you over. Remain still until the bear leaves the area. Fighting back usually increases the intensity of such attacks. However, if the attack persists, fight back vigorously. Use whatever you have at hand to hit the bear in the face.
Black Bears: If you are attacked by a black bear, DO NOT PLAY DEAD. Try to escape to a secure place such as a car or building. If escape is not possible, try to fight back using any object available. Concentrate your kicks and blows on the bear's face and muzzle.
However they also note:
If any bear attacks you in your tent, or stalks you and then attacks, do NOT play dead—fight back! This kind of attack is very rare, but can be serious because it often means the bear is looking for food and sees you as prey.
Generally there are two main types of bear behaviour defensive or non-defensive (Curious or Predatory). Defensive attacks are the most common attacks especially with brown bears.
Parks Canada provides advice based on these two behaviours
Is it DEFENSIVE?
The bear is feeding, protecting its young and/or surprised by your
presence. It sees you as a threat. The bear will appear stressed or
agitated and may vocalize.
Try to appear non-threatening. Talk in a calm voice. When the bear
stops advancing, start slowly moving away. If it keeps coming closer,
stand your ground, keep talking, and use your bear spray. If the bear
makes contact, fall on the ground and play dead. Lie still and wait
for the bear to leave.
Is it NON-DEFENSIVE?
A bear may be curious, after your food, or testing its dominance. In
the rarest case, it might be predatory–seeing you as potential prey.
All of these non-defensive behaviours can appear similar and should
not be confused with defensive behaviours. The bear will be intent on you with head and ears up.
Talk in a firm voice. Move out of the bear’s path. If it follows you,
stop and stand your ground. Shout and act aggressively. Try to
intimidate the bear. If it approaches closely, use your bear spray.
Handling an ATTACK
Most encounters with bears end without injury. If a bear actually makes contact, you may increase your chances of survival by following these guidelines. In general, there are 2 kinds ofattack:
Defensive
This is the most COMMON type of attack.
Use your bear spray. If the bear makes contact with you: PLAY DEAD!
PLAY DEAD! Lie on your stomach with legs apart and position your arms
so that your hands are crossed behind your neck. This position makes
you less vulnerable to being flipped over and protects your face, the
back of your head and neck. Remain still until you are sure the bear
has left the area.
These defensive attacks are generally less than two minutes in
duration. If the attack continues, it may mean it has shifted from
defensive to predatory—FIGHT BACK!
Predatory
The bear is stalking (hunting) you along a trail and then attacks. Or,
the bear attacks you at night. This type of attack is very RARE.
Try to escape into a building, car or up a tree. If you cannot escape,
do not play dead. Use your bear spray and FIGHT BACK. FIGHT BACK!
Intimidate that bear: shout; hit it with a branch or rock, do whatever
it takes to let the bear know you are not easy prey. This kind of
attack is very rare, but it is serious because it usually means the
bear is looking for food and preying on you.
It is very difficult to predict the best strategy to use in the event
of a bear attack. That is why it is so important to put thought and
energy into avoiding an encounter in the first place.
You should be passive and non threatening when dealing with a defensive bear. A defensive bear can still exhibit "aggressive" behaviours including bluff charges which is likely what they are trying to refer to. Best advice for staying alive is preventing an encounter by making lots of noise, keeping food/attractants secure, and disposing of garbage properly.