How to contact someone (including me) about joining their lab:
By the time you’re contacting the PI to ask about joining their lab, you should already know the lab’s main research topics and methods, have read their recent publications, and found a good fit between your goals and interests and the lab you want to join – correct? If not, this is what you start with. I cannot emphasize this enough.
Then you can e-mail the PI to introduce yourself and briefly explain your research interests and career goals and ask if there are any appropriate research opportunities in their lab at this time. Be sure to specify what you are looking for (postdoc, graduate study, research assistantship, volunteering, etc). Include a CV. For undergraduate students, you need to include your GPA clearly and you may want to attach an unofficial transcript. Be prepared to provide names of 2-3 individuals who can write recommendations for you. Of course, you should notify these people in advance and tell them about your plans to apply for research positions. If you are going to be visiting the city that the lab is located in, or attending a conference that the PI might be attending, you might want to mention this as well.
How to avoid some common mistakes
Do not send the same letter to everyone. It is very easy to tell apart a well-thought out inquiry from a generic e-mail to a large group of professors.
Do not send an email that is vague (e.g., I am very interested in your research). Professors like to see that you have done your homework before contacting them beyond being interested in “their research”.
Check your email settings and include your name in your message. Your message may appear to come from surfergirl891 or something similar, which is not what you want.
Check and recheck your spelling and grammar. You do not want to make a sloppy or careless first impression.
Academia is not an overly formal environment. However, the general view among professors is that you should not address them with their first name in your first email. If they sign their message back to you with their first name, you can then start using it in subsequent communication.
Do not assume all science professors are male and address the PI as “Sir” or “Mr”. You shouldn’t address them “Miss” or “Mrs” either. The PI’s gender is irrelevant. “Dr” or “Professor” are appropriate greetings.