Bear spray is ultimately more effective than a bullet, unless you've had 100% successful experience killing a bear with one shot. Simple fact, brought to you by Montana Fish, Wildlife and Parks. 

Agreed with others: your behavior, awareness and psychology is your best practice in bear country. Oh, and a headlamp will help discern shadows from KILLER BEARS. 

Unless you're doing a Three Stooges remake...