When the Job Isn't a Good Fit
How you turn down a job offer depends on your reasons for rejecting the offer. If the job wasn't a good fit, but you liked the company, you could state in your email or phone call that you were impressed with the organization, but didn't view the job as right for you. Your response might include a mention of the key skill sets that you would like to employ, level of responsibility that you aspire towards, or other elements of the prospective job that were missing.
For example, if the target job involved only inside sales, you could say that you were interested in a sales position handling major accounts that would provide a clear pathway to sales management. The possible upside will be that the employer might consider you for another role currently available or a job that might open up in the future.
When You Don't Like the Company
If the company is unappealing because of its culture, your prospective supervisor, products, or services, etc. then a simple thanks for the opportunity with a vague reference to the job not being a great fit at this point in your career will be sufficient. Candidates are generally better off not expressing any dissatisfaction with the staff with whom they interacted or sharing any criticisms of the organization. You never know when your path might cross with any of the players in the future.
When the Job Doesn't Pay Enough
If a job and organization are attractive, but a salary offer is insufficient, you might address this issue in your communications. Normally this would be done after first affirming your excitement about the offer and trying to negotiate a higher salary. If this effort is futile you could send a communication expressing your thanks and reaffirming how excited you were about the job, but stating that you need to decline due to the level of the salary.
Sometimes an employer will come back to you with a better offer at this juncture once they see that you are truly willing to walk.