When your gf sees someone else as better than you what you are supposed to do if you love her? Do you have to win her mind somehow, or does it mean it's completely over?
Most guys go into control-freak mode I reckon and create bad situations. I think the best thing to do is to remind her that you love her maybe? Then hopefully she doesn't leave you for him. Also, with the guy, you can't really tell him to stop being awesome, so maybe you have to keep it all to yourself and be honest with him that he's a great guy and that you respect him. Make him know you're not worth losing as a friend too.
If she leaves you for him then I guess all you have to do is move on and find someone else? But when the emotions are deep that's very hard to do.