To scare away a bear you should scare the bear away by making loud noises by yelling, banging pots and pans or using an air horn.
If faced with a bear coming up to you the first thing you should do is try to get away from the bear by backing off slowly.
Don't seem like a threat to the bear or it could attack.
If you have to scare away the bear you can do so but your first option should be to get away from the bear.
Most bears will not bother you as long as you leave them alone and stay away from them but if the bear does start coming towards you then you can scare off the bear.
To scare off the bear you should make loud noises by yelling, banging pots and pans or using an airhorn etc.
The bear should then be scared and run away from the noises.