wow, I'm sorry OP that has to suck. would the rival company be similar in the job description so you could work there. if not I'm sorry and good luck finding a new job!
I would have told them to call me 007 before leaving dramatically. Nothing can go wrong being James Bond, even being turned down from an awesome job. Just go apply there and say it was meant to be!
Side note: dick move by the company to not hire you for that reason. Stupid.