1. What you have read are the words of the conversation, not the actual feel or intention behind it. So your picture is incomplete and chances are that you are reading everything wrong. Your preconceptions about your friend aren't helping either.
2. You're in murky waters now. Get out quick! I would try to defuse the situation. Try something like "Honey, I'm sorry I was a total jerk. You left your IM open and I couldn't resist reading your conversations. Sorry! I'll do better next time."
What you say next depends, of course, on how she takes this. Note one thing, though: you have absolutely no right to be angry with her at this point. You made the mistake by invading her privacy (to which she is entitled, even within the confines of a relationship). Whatever she talked about with your friend and what that means is between him and her.