It's an unfortunate part of every writer's life. You want to avoid it, and over time you get better at it, but it still happens from time to time. You submit a piece, wait a month or two (or more!), only to get a rejection notice in return. It's a natural part of what we do, just like striking out is a natural part of life for a baseball player, or losing a patient is an unavoidable part of the ER surgeon's world. God never promised us that everything we did would be a success. Sometimes we need to failures to keep us humble and/or to teach us how to do things differently in the future.
The question is, how do you handle it? What do you do after the rejection comes? Do you throw up your hands and quit? Do you lambast the editor as an idiot who can't be pleased or who doesn't see the brilliance of your work? Here's what you should do....
1. If the editor offers feedback, be teachable. A lot of editors won't bother giving you anything more than a simple form rejection, so if they take the time to tell you what didn't work, you need to take the time to read and consider it. You may not always agree with everything that they say, but chances are they could point out something that could really help you later on. I used to have a bad habit of starting my stories out with pages worth of backstory (establishing what "normal" was before I shook it up), until an editor suggested that I start with the change so as to hook the reader. After I applied that advice, I got a lot more of my work accepted. If an editor gives feedback, they're probably trying to help you, and you should look at it in that spirit.
2. Take a good look at the story yourself. Try looking at it with an editor's eyes, pretending that this piece is somebody else's "baby." Does anything jump out at you? If so, that may possibly be something you want to address.
3. Don't be afraid to revise. None of us is so accomplished as to produce perfection everytime. A few tweaks may be all it takes to make a story more acceptable. Then again, it may take an overhaul, but don't be afraid to do it. A number of my stories that have been published were once rejected until I made some changes.
4. Try, try again. What one editor rejects may in fact look great to another editor. Just because one market rejects a given story doesn't necessarily mean it's a piece of junk. Isn't that how rejection works, anyway? Few of us got the first job we ever applied for or married the first person we ever dated. Why should submitting our writing be any different. Keep trying.