Unfortunately, for aspiring authors rejection isn't just a passing disappointment - it's a way of life.
As a writer, you can count on getting hundreds of rejections. And - I hate to say this - your hundredth rejection will sting just as much as the first.
At some point, you will be tempted to throw in the towel.
Don't do it. Try my foolproof method instead.
The method
Before I explain my tried-and-true method for handling rejections, I have to preface it with the admonition that it will take a little organizational work on your part. Ideally, you should do this before you start submitting your work. After all, you want to avoid as much pain as possible. Of course, if you have already started submitting your work and are in the throes of an existential crisis, it still isn't too late.
1) Make a 'top 50 list.' Find 50 places to submit your work and rank them in order of desirability. (For example, if you are submitting a story, the top slot could be the New Yorker.)
If you are submitting a short story, go here, and find 50 literary magazines.
If you are submitting query letters to agents, go to Agentquery and make a list of 50 agents for your genre. (Be sure to check Agents Seeking Clients here.)
Resources for Science Fiction/Fantasy writers are here.
Resources for Children's and YA writers are here.
Resources for Romance writers are here.
Resources for Mystery/Thrillers are here.
2) If your top slot says "no simultaneous submissions" then, immediately after getting your rejection, submit to the #2 spot on your list.
3) If your top slots - or your remaining slots - don't say "no simultaneous submissions" submit to all of them at once. One of them will take you, and your waiting time will be considerably reduced.
4) If you are submitting to agents, make sure you revise and hone your query letter as you submit, but keep working your way down your list. Don't stop.
5) When you get close to number 50 (and I have done this more than once), make a new 'top 50 list.'
Do this doggedly - without pausing to contemplate the futility of writing or the pointlessness of existence - and you will do just fine. And keep writing! Having several of your works making the rounds on your 'top 50' will increase your chances of success.
You may find, as I did, that by using this technique you will not only avoid the rejection blues, you will get published.