All great advice, but i will chime in once more, often times a gun can save your life without being fired...
It's the OH S**T factor, or Pucker factor as my dad calls it.
Most guns have to be seen to induce this fear in an intruder, but as another member said a pump action shotgun will induce this to the greatest degree, and without being seen.
The sound is recognisable the world over, and because of the spread you are almost guaranteed to get a hit. Nothing will stop an intruder, and keep them away as effectively as a 12 gauge.