First off, take a few sentences to describe yourself (the letter writer), your background, and your exposure to high-caliber students. We want to know the group of students to which you are comparing when you say "great student" or "one of the best".
State clearly in what capacity you worked with the applicant, and for how long.
If you know the applicant in a research context, you NEED to talk about research.
Compared to others on the team, how does the student compare? Is he performing at the level of a PhD student? PhD graduate? It can be difficult to place a student in a percentile (i.e. to say top 5% or 10%), but know that many other people do put this in their letters, so committees look for it.
If you interacted with the student in a teaching capacity only, this makes your letter much more difficult. Focus on research-related classroom contributions (paper discussions, projects). This is more important than the student's final grade.
If you are in industry (and so the candidate is not a student, but an employee), the letter is difficult too. Leadership, drive and determination are important traits to portray. Solving very technical problems is also a plus.
Do not devote more than a few sentences to personality. But do mention it if you feel it is important. Be aware of language biases when writing letters for women (http://phys.org/
Don't be afraid to point out flaws. No applicant is perfect, and pointing out the good and the bad makes the letter more honest. What are their weaknesses? Have they done anything to compensate for them? Are they aware of the weakness and are working on it?
On that note, are there any notable flaws in your candidate's application? A semester of bad marks? A non-traditional background? Discussing these in the letter can be very helpful.
Keep it brief. The committee I was on read 300 applications in 2 weeks. That's 900-1200 reference letters, not to mention all of the other material in application packets. Make your points clear and succinct.
In the end, remember that I want to like your candidate! Your letter should help me do that.