We usually recommend bear spray, but when that is not an option screaming at the top of your lungs and trying to intimidate the bear is another option. Check out this video of a hiker successfully intimidating a charging bear. Caution, Profanity.
Video from LiveLeak.com