A Gracious Tone. Your resignation letter is not the time to air grudges, take passive_aggressive shots, or otherwise be unpleasant. Regardless of how you feel about your (soon to be former) job or your boss, this letter should be an exercise in professionalism and graciousness. An excellent way to do that is to say a simple "thank you." Even if you hated your job, you got something from it at some point. Focus on that positive bit if you need to.
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.