When writing your cover letter, keep in mind that the reviewer is only interested in one thing: the facts. Do not think of your cover letter as an autobiography; it should be brief and to the point. The purpose of the cover letter (and resume) should be one thing – it should demonstrate that you meet or exceed the requirements listed in the job description. It should demonstrate that you're interested in the position, and that you're available to accept the position if offered. Additional information beyond this can be counterproductive, as it dilutes the core purpose of the cover letter.
When writing the cover letter, avoid negatives. A cover letter is not the place to explain why you left or are leaving an employer, why there are gaps in your employment dates, etc. These "negatives" are best delivered in person during the interview so that your personality can counter them.
Try to avoid a salary history in the cover letter. Even if the position specifically asks for your salary history, providing this information will more likely cost you a job than not. If the job ad specifically says that resumes without a salary history will not be considered, give a historical salary range, and state that your salary requirements are flexible based on the opportunity the position will provide.
Spend time thinking about the layout of your letter, and make sure that it's easy on the eyes. It should be easy to scan the letter, and have a logical progression. Keep in mind, the reviewer of your cover letter and resume has hundreds (if not thousands) of cover letters and resumes to look at, so make it easy for him/her to find the information you want to highlight. Bunched up text in long paragraphs will frustrate anyone who has to review hundreds of resumes and cover letters a week. In addition to the layout, don't just repeat your resume. Your cover letter is not a summary of your resume; instead, it's an introduction of yourself, and an argument for why you are the best candidate for their company and the specific position. Above all, avoid the generic cover letter that you get from books.