job applications have to be assessed without discrimination. You can't pick and choose on the basis of race, gender, disability, age or whatever. If jobs are going to friends then that might be discriminatory - if were shown that the effect is to discriminate against people who are black, old, women, gay, Sikh or Blue Helmet Wearers. Put simply, Mr. X, you have a case. Proving it, and proving that you are on the wrong end of discrimination might be difficult. On the other hand the company might be called on to show that they hire without discrimination - and this would be tested by what they did as well as what they have on paper.
If you want to pursue it, get in touch with ACAS
http://www.acas.org....?articleid=2030
ps - I agree with Ben - you probably did well not to get the job