If a bear were charging you, how many people would know WHERE to shoot it for best effect? I know I wouldn't.
If you choose to carry a firearm for bear protection (I do not), the best place to shoot is to try to break the shoulder. This is the recommendation of most bear hunting guides.
The brain is actually relatively small, and is encased in a very thick skull, with a sloping front. Not an easy shot, and if you are off even slightly, you may have a very angry bear with a bad headache. Heart or lung shots will certainly kill the bear, but may not stop it in time.
The shoulder is a reasonably large target, and if hit will stop or at least slow the charge. Also, if the shoulder is hit, the bullet will generally pass on through into the vital organs. Note that this assumes a weapon with sufficient penetration! Bears may look rolly polly, but underneath are solid muscle, and their bones are very stout, hence the recommendation for large calibers, and bullets designed for lots of penetraion (not so much expansion).
I'm not certain exactly why/how pepper spray works as well as it does, but it does.