... prepare, prepare, prepare !!!
I don't think it's possible to adequately prepare for a bear attack... especialy if you are sleeping in your tent and a bear decides to make you his lunch !
An attack survivor described hearing the bear chewing on a bone realizing the bone was her skull ! She fought back and survived.
The best You can do is equip yourself with knowledge (and you fav. gear) and not worry too much ...