Prepare for It. The best way to prepare for this reaction is to simply know your stance ahead of time by determining if you would even consider a counteroffer. Yes, it may be more money or a better title, but there's more to consider__including your career goals, level of job satisfaction in your current role, and the opportunities that your new role offers.
A Professional Greeting. Your letter should be addressed to your boss. There's a good chance that this letter will merely end up in a file in HR, but it starts with your boss. Assuming this is someone with whom you work reasonably close with on a daily basis, it doesn't have to be super stiff and formal. Specific and professional is the right tone here.