I'm continually surprised by how many people don't realize that the "required qualifications" in job ads are like wish lists, not inflexible lists of requirements. Those qualifications are a composite of someone's idea of the ideal candidate. Believe me, they will look at people who don't perfectly match it. So when a job posting requires four years of experience and you only have two, you're not automatically disqualified. If you think you could do the job, apply anyway.
That said, if you're a bit under-qualified, you need to work for it more. Here's how:
1. For starters, you must write a fantastic cover letter. If you don't do this and you're under-qualified, you have no shot. (See tips on writing a great cover letter here.)
2. Learn a ton about the company you're applying to, and let it show in your cover letter. I'm impressed when people know more than the basics about my organization and tie it into why they want to work for us. It's like the way it's far more enticing when a guy I'm dating talks specifics about why he's interested -- as opposed to seeming like he's looking for someone to fill the "girlfriend" slot he has open.
3. In your cover letter, acknowledge that you don't have every qualification they're looking for, and explain how you'll make up for it. (Be realistic here -- if they're hiring a graphic designer and you have no design experience, this won't work.) Acknowledging it is good because (a) it shows you paid attention to the ad -- something most people don't do -- and indicates an attention to detail that hiring managers love to see and (b) it shows that you're not one of those insanely overconfident candidates with no humility or sense of your own weaknesses.
4. Be likable. This is always important in a job search, and it's especially so when your qualifications alone aren't going to rocket you to the top of the pile. This means be friendly, not pushy or overbearing, and genuinely interested in the job, the organization, and your interviewer. Make it easy for us to want to help you.
5. From the cover letter on through the interview process, really paint a picture of things you've done well in past jobs (including volunteer jobs, if the reason you're under-qualified is because you're a recent grad or stay-at-home parent with little work experience). I recently interviewed a candidate with no direct experience in our line of work. However, she had worked as an assistant to a high-profile local personality, and it was clear she had juggled an enormous workload, stayed highly organized, and been generally indispensable in making his life run smoothly. I love those skills, and they can rarely be taught. So I don't care that she's never worked with the databases her potential position would require; I know enough about her now to know she'll pick it up quickly.
Remember: Job ads are wish lists. Don't be deterred if you're not a perfect match.