How to compose a great recommendation letter?
There was a good link that I'd found on this topic, while applying to graduate school:

Advice to Graduate School Recommendation Letter Writers

The above link is a pithy list of points to be kept in mind by new letter writers. As a summary, I'd like to highlight some sections of it that I've found repeated in other such articles as well:


  Be Concrete
  
  If you take away just one piece of concrete advice, let it be this.
  
  The single biggest problem with most letters is that they are filled
  with abstract generalities and infinitives. If we don't know you or
  your institution, we can't judge what any of these statements mean
  relative to our standards. Always consider the illustrative anecdote:

Due to deadline pressure, I asked him to grow a pumpkin in just one month. As you know it takes over 100 days to grow a pumpkin, but over the weekend he devised a new method to accelerate their growth. On Monday morning I arrived to find not just a pumpkin but a steaming, flavorful pie. 

  
  Anecdote about acts of raw coding are only so helpful in understanding
  research potential, but they're better than nothing (see the section
  on Corporate Letters, below). An extra book or paper they read, and
  demonstrated understanding of (again, be concrete about why you
  believe this), goes a long way.
  
  Corporate Letters
  
  An important special case is the corporate letter: when you, the
  letter-writer, work in industry and have no academic affiliation. Many
  corporate letters (like many academic letters, but more so) tend to be
  vapid, clearly written in a different culture and for a different
  audience. Unless they actually did academic research with you, here
  are some suggestions for improving them.
  
  A common mistake is to focus on teamwork. This is important even in
  academia, but often this is the primary focus of the letter, which
  makes it less valuable. Of course we care about it, but it's secondary
  to their technical skills.
  
  
  Tell us if they learned something particularly quickly, mastered a
  complex technology, or solved a problem others were stuck on. Give
  us a paragraph of details.
  If you have a concrete reason to evaluate research potential, do so concretely. Otherwise, don't bother.
  Give us a brief bio-sketch, including educational qualifications.
  4.Put the applicant in context, and tell us the context. It's fine to relate it to your own student days, or to your experience hiring students.
  E.g.
  
  Compared to the students I studied with at Cucumber and Melon University, and the ones I now recruit from there, I would put him in
  the top 10%.