A spear is a ranged weapon, this makes is very powerful against any creature that relies on close ranged attack, in skilled hands a bear would not even threaten it.
Can I shoot a bear if it attacks me?
Firearms are not recommended for stopping an attack.
Using a firearm during a bear attack may only worsen the attack. An injured bear will be more aggressive, especially during a fight.
Could a man fight a bear?
A bears claws could shred a human to bits and their bite can crush bone while a humans punch would do nothing to the bear accept piss it off making the bear even more motivated in winning a fight. So no unless the human has a weapon there is no chance in winning a fight with a bear.