Can I shoot a bear in self-defense? Will I face fines and jail time if I do?
For hunting bears you have to check with your local rangers for hunting season, permits and so on.
Self-defense is self-defense if your mental state does not allow you to think and you feel killing is the only way out than it the only way out.
Bear Defense Spray is more effective and easier to obtain than .45
Noise will scare them off. So if you shoot don't shoot the bear just shoot in its direction to spook it away from you.
You can. Bear spray is a more humane option; however, you do ask about legal repercussions. You can shoot pretty much any animal in self defense in the USA. After you shoot the animal it is important what you do if you want to avoid fines. Once the fight is over and you know you are safe you need to call the forest service. If you don't know their number call 911 and they can and will help you.
Source: Last year a buddy of mine killed a Mountain Lion (cougar) in self Defense and didn't have a tag for one. A guy came out and looked at the Cougar, asked some basic questions like what weapon was used. Where was he standing. Where I was. What was the Mountain Lion doing that made him feel he had to kill it. When did it happen. The last question was "Will you help me carry it back to my truck?" He filled out a piece of paper with our info and that was it.
During the carry back we asked about what happens and he told us that depending on very technical qualifications such as if he wants to eat the animal or not and how far is is from his truck determines if he hands the hunters a tag and says have a nice day or takes it himself. Also, he said that if it was obviously not self defense or he had a bad feeling about it he could get the police involved but usually doesn't have to.
You can shoot a human in self defense, so don't worry about shooting a bear if you have to. I have UK military experience, and let me tell you, shooting a moving target with a handgun is difficult. If a 400kg bear is coming at you, and you only have 5 seconds to get an accurate shot away with all the adrenalin flowing, then chances are you will not stop the bear, even if you are well practised with the handgun.
The only firearm I would consider for a CLOSE encounter with a bear is a pump action shotgun. Easier to aim and far more stopping power. Not a particularly convenient or inconspicuous piece of kit to carry when hiking! But you do have that as a legal option here in the U.S.?
But bear(!) in mind, your mindset will change if you are carrying a firearm. You may be tempted to go for the gun too readily when there is perhaps a better alternative course of action, e.g. talk loudly, avoid eye contact and move away slowly.
Still, if I had a shotgun and bear spray, I would instinctively go for the shotgun first, which may be less effective than the spray. Given enough time though, I would fire shots in the air, before aiming at the bear. I have seen u-tube videos of Grizzlys scampering away in fear from the noise of a shotgun.
The TL;DR answer: Yes.
You can always kill in self defense if your life is in serious danger* from the animal or even person you're shooting, e.g. if you have good reason to believe they are trying to kill you (for instance because they're a bear and they're charging) in any jurisdiction I know of. It doesn't matter if that animal/person is the last white tiger or the queen of Britain. It even doesn't matter whether in hindsight you were actually in danger. If the bear is drawing what after the fact turns out to be a fake gun on you (I know, great example) you were still in the right, because you had no way to know it was fake.
If you ever die messily, let it not be because you wondered about local laws.
*Some jurisdictions like several US states use a more relaxed idea of serious danger, while other places like much of Europe are stricter, but getting mauled by a bear counts everywhere, even in places without bears.
See all the other answers for things to consider and some great alternatives.
EDIT: Oh wow, didn't see how old this question was.
Most people make far to much noise when in the woods to ever see a bear unless you have some munchies. The few bears I've come across took off as fast as they could. Nothing closer than 50' though but they rarely want anything to do with you anyway. But to answer the question yes you can defend yourself
Bear spray doesn't always work and isn't even allowed in Yosemite. Guns are allowed in Yosemite by federal law per state law as Idaho, Wyoming, and Montana have sensible gun laws. There are similarly stupid rules about bear spray in other parks. It's not stupid that guns ARE allowed as a backup plan is just good business, it IS stupid that bear spray isn't allowed as, when effective, it may be a better option depending on the circumstances.
A charging bear is "faking" about 90 percent of the time, but if I knew I was going to get shot in the face one out of ten times I went out my front door, I'd go out the back way. If I was facing something that was going to eat me one out of ten times (i.e. a charging bear) I would not rely on a method that was not completely reliable for prevention of dietary inclusiveness. I would use a gun, I might fire a warning shot if I could retain sufficient presence of mind, but if the bear didn't respond immediately it would be dead as immediately as possible. High caliber cast bullet pistol rounds (not .45, I know of people who've had to empty two magazines into a medium sized black bear to get any traction), large caliber high velocity non fragmenting rifle rounds, or shotgun slugs, preferred.
I know there are "studies" that say a gun is less effective than bear spray, but I find those studies in complete. The only bear that's incapable of killing me is a dead one.
Bears don't have a "natural" fear of man. Men killing and hurting bears is what makes bears fear men. I'm ok with letting bears live and have no interest in hunting them, but for any bears around me that will be an option and not my sole resource. It's just foolishness to be unprepared.