One of the more unpleasant parts of my job is having to tell candidates that they haven't got a job that they really wanted. Often, there is no easy way to let some one down and it is natural for people to experience feelings of rejection.
It is important to remind yourself if this happens to you that modern recruitment practices involve writing a strong job specification against which all candidates will be measured. If you haven't got the job then it will be that a candidate has scored higher than you against elements on the job specification. It is always worth asking your consukltant or the company which areas they thought you were weaker on than the candidate who got the job. In some cases, you will not be able to improve in these areas if you have not got the skills required but there will be occasions when you can learn from what they tell you and make yourself stronger for your next interview.
I am also a firm believer that if a company turns you down then maybe it wouldn't have been the right job for you anyway. Don't dwell on it - move on. Many years ago on a training course, an American trainer told me that you should get excited about the "no's" you receive because it means you are closer to a "yes". If you adopt this philosophy then it can also help with those rejections.
And if all else fails, a long walk or a glass of wine might help you to battle on!
Jeanette Robinson FREC (Hon)