How do I effectively solicit a strong letter of recommendation from a professor?
Start Early

Most of the people you're asking for recommendations are busy.  They are usually happy to do this for you, but they appreciate every effort you can make to help them work this task into their calendars.  Sixty days is NOT unreasonable, but three weeks is what I consider the very lowest time frame before considering the requester to be discourteous.

Ask the appropriate people

We enjoy moving our students on, and do what we can to help them.  On the other hand, we understand that writing recommendations that look like form letters is not going to be helpful.

Make sure that the people you are asking for a recommendation are the right people.  If you got a "B" in a class of sixty students, and never had a real conversation with the professor, that person may not be the right person to ask.  If it's the best you can do, so be it, but some planning in earlier years might have led to a better recommendation.  That said, that prof who gave you a B in a course where you got an A on a term paper that you're proud of might be the perfect person to ask -- for example, if English is not your first language and your ability to effectively communicate might be called into question by an admissions committee, a letter focusing on this might resolve the issue.

Before it comes up, yes, your academic adviser is usually good for a recommendation if you don't have more appropriate letter writers, and to some extent that person will feel responsible to write you as strong a letter as possible.

Ask for an appointment to discuss the letter

This sort of thing should not be arranged in passing, especially if you intend to get the best letter you possibly can.  It also shows that you're serious about the request, and not taking it for granted that this person owes you a recommendation.  As part of that meeting, you might consider giving the prof an overview of your application package, and asking the prof if they see any ways to improve it.

At that meeting ASK if that person is in a situation where they feel that they can write you a STRONG letter

Frankly, there is sometimes a disconnect between the student's view of a faculty member's opinion of them, and the actual opinion.  Make sure you are not in this situation.  Often, people will be very frank about this, and let you know that they can't write a very strong letter for you.  Sometimes you don't even need a strong letter, and just need the writer to make a point that you're otherwise having trouble making in your application package.  If the person says "I can't write a strong letter," you can say "Can you write a letter that helps me make this point?" and see what the answer is. If you're getting desperate, you might even ask something like "would you be able to say I'm in the top half of students you instructed?"  If the prof says yes, and indicates that this is the strongest recommendation that can be written in this situation, at least you know where you stand and what the letter will say.

Explain why you are asking that particular person for a recommendation, and what you would like that letter to say

Consider the example above about communication skills.  Again, if you feel a certain prof is in a position to help you make a point, ask if they can help you in this way.  Maybe you're a member of a large student group that has had a very successful project, and now you're asking the group adviser to write a letter saying that it was an important project, why it was important, and that you were a part of it.  LET THE PROF KNOW that this is what you'd like the letter to say.

Prepare your package

Make it easy for the prof to write your letter, and give the prof all the background material that will help.  This can include (but is not limited to): 


Your resume
Your transcript (if appropriate)
Your grades and performance summary for the courses you've been
involved with the recommender for
ANY PERSONAL STATEMENT THAT YOU'VE WRITTEN FOR YOUR APPLICATIONS (this is a big help to me, and I always ask for it.
A complete list of all the places that will need the letter, and
their deadlines
Any special circumstances (e.g., rolling admissions that require
some rushing).
Any language that you'd like included.  It seems silly, but as your careers develop you'll be in many situations where people ask you to give them the letter that you'd like them to put on letterhead and sign.  Doing this for a letter of recommendation is a bit presumptuous, but if you're trying to make a very specific point with the letter, you might offer a few sentences of recommended language.


Follow up

As a last step, tell the person what your process will be.  Let the person know when you will be completing your application, and when they should start seeing the requests from schools.  When you do apply, it is a good idea to send off an email that says "I've just finished these applications, with the following deadlines for letters.  Please let me know if you don't receive requests."

Establish a nagging plan with the profs.  If you tell me the deadline is Apr 1, and I acknowledge that, please don't keep sending emails saying "its not there yet" right up until April 1.  That said, at the meeting you'll hold with me in advance, say "I'll send you reminders of all  the schools with upcoming deadlines in mid-March", I actually appreciate it.  Personally, I have some anxiety where other people are key in my loop, so I can understand it if somebody says "I know the deadline is Apr 1, but I'd feel much less anxious if you could have this in by Mar 26" -- just let me know about it.  Otherwise, the deadline is the date certain for me.  Normally, I try to get these things submitted earlier, but sometimes it doesn't work out that way.

Don't drag this out.  We literally get dozens of emails a day.  Try to complete all your applications in chunks, so we can take all the request messages, slam them into a directory where we can find them when we need them, and not have to go searching at the last minute.  It challenges my organizational abilities when 15 recommendation requests for one student dribble in over the course of a month, especially when I've signed on to write letters for a half dozen students or more.

Confidentiality

We expect to be writing confidential letters.  If you don't intend to waive your right to inspect, please let us know in advance, so we can tell you if that's acceptable to us.  Trust us -- we write the best letters we can.  If you have the frank discussions I've recommended above, you know just where you stand (and maybe we can even nudge things up just a hair).

Results

As a courtesy, let us know how things worked out.  We love to know about our students successes, and it can even help us tweak out our future letters.

Last Points

When someone agrees to do something that directly impacts your future, that person owes you the respect of appropriately placing that action on their priority list.  If it's important to you, and they agree to help, it should be important to them.  

If someone hems and haws about providing a recommendation, its probably because they don't feel that they can write a helpful one.  If you keep trying to schedule that meeting and it keeps getting put off, you might be dealing with someone who just is unwilling to give you the straight answer that you need to hear.  I try to be as straight with my students as I can, but it can get VERY awkward in certain cases, particularly if they're currently in your class that requires constant interaction.  Having these conversations is not easy from either side, and some people choose to avoid them.

Keep in mind that when we write letters of recommendation, we are aligning our reputation with your value as a student.  We can not write tremendously positive recommendations for students that don't merit such treatment for too long before admissions committees simply dismiss our letters.  Anecdotally, every now and again I write a letter of recommendation to our own Medical School.  Once, at a purely social event, I had a conversation with my Dean of Admissions to the Med School about a special applicant who I thought might not have looked as valuable as she was in her application package.  I asked the Dean if he would welcome the conversation I was trying to have with him, or whether it would be out of line.  He indicated that he really appreciates such discussions, and he was able to mention by name a good number of applicants who were admitted with a letter from me in their package.  People DO PAY ATTENTION TO THIS STUFF.  

NEVER place someone on a recommendation list for an application or a job without their prior knowledge and their OK.  AT the very least, it's annoying to be blindsided.  At worst, you're shooting yourself in the foot.