First you have to judge how your boss and other's in the company (e.g. boss' boss), will react. Some will be offended that you looked elsewhere, and as soon as you tell them, you're on the blacklist no matter what you do. They might even feel that you're blackmailing them. (You're not, but some people react strangely to this.)
Here are the questions he will ask anyway, so be prepared to answer them, or even bring this up yourself:
- Did they find you or did you look?
- If you looked, why? Something at your current job made you look--what was it?
Next consider the salary/benefit/job combination. Why is this job paying so much less? Is it a junior position, or some basic task (e.g. I can charge very different amounts for basic programming, project management, and cryptographic consulting) so that it doesn't make sense for them to pay more? Alternatively have they claimed recession and not given you any raises the last few years? (See my comments
here about valuations of different jobs.)
The "why" is always important to consider. You can't simply say, "I want more money." Saying "they'll pay me more" isn't much different. You need to justify the higher salary to your current boss.
If there are other issues at your current job, it's important to consider them. Did you not like the projects, etc? That might not change. (Although it sounds like you do prefer the current job.)
You should sit down with your boss and discuss all this. Tell him that you're interested in staying, but feel that you're underpaid (and this new offer confirms that theory). Don't just assume he'll counter-offer.
--Mark