If you can acknowledge your fault, you have to be careful not to go overboard with guilt. I know what it can be like to get lost in the moment and make a mistake. You're responsible for your own actions so don't let yourself off the hook but you have to forgive yourself for being human when you inevitably bite the bullet. You're going to have enough of a crapstorm to deal with being thrown at you so write down where you feel you were at fault...seriously ask yourself what really happened between them (as best you can guess) what happened between the two of you, what about it was a mistake and why was it a mistake. Seriously, even if you feel you're being condescending to yourself, break it down as a problem and start solving it for your own sake of guilt or remorse. By solving it I don't mean emotionally, I mean knowing the consequences of your actions and how you can possibly make up for it (if that's possible) or at least how you can control the damage to the best of your ability.
Sounds like you really screwed up. Coudos for being able to admit it and acknowledge it, it'll be a real test of your emotional ability to try to balance the situation objectively. Like I said, don't let yourself off the hook but remember it takes two to tango so even if you were coming on to him really hard (which it doesn't sound like), it can only be 50% your fault. Not that it makes your side of the fault any less but if you're going to be knee deep, he should be neck deep so he might make excuses and try to put the blame on you. By the same note he's responsible for his own actions too. Let her deal with him, and then let her deal with you, after all, you may be good freinds but you aren't the one going out with her. He also screwed up big time. That's no excuse though.
Precious and fragile things
Need special handling
My god, what have we done to you?