Being online is a real tightrope for some people. I think it allows them to flirt - but they also feel like there is a safety cushion of distance to it.
I totally get the idea of getting in touch on FB with someone you knew back in high school and used to date, etc. I have several FB friends who I dated and even a couple ex-boyfriends.
Only ONE guy I used to date tried the 'whoo, we were so hot together, are you still hot?" approach on me and I just told him nicely but firmly that it was great to be in touch with him again, but I was married and not into text- flirting! He apologized and to be honest, I don't hear from him much anymore, but I feel like he got the message and we parted on good terms.
The other people I used to date are all in relationships, just as I am. There is a certain amount of nostalgia that is acceptable IMO- saying " wow, what a great year or a great time we had' is one thing. Going into graphic details or even SUGGESTING that you want to do it again, is where I would draw the line. Unfortunately a lot of people can't seem to do that.
It seems to me that some people just can't bear to turn off another person's admiration. They are so happy to feel like someone still finds them attractive, or remembers them that way, that even if they are PERFECTLY HAPPY with their current relationship and have no intention of cheating, etc. they just can't stop and think and say " hey, this direction is not really where I meant to go with getting back in touch with you." Some people just see flirting as harmless, which it can be- but not when you have a partner whose feelings can be hurt by it.
I think you are going to have to fess up to looking at his phone. Just be straight about it and tell him you know it was an invasion of his privacy and you apologize for that. But- don't be intimidated, because the issue of the texting/flirting is still the bigger issue.
Tell him just how you felt when you saw the intimacy of their messages. That intimacy is something that should be reserved for his marriage, IMO. Ask him right up front if he is dissatisfied with your marriage and if he is considering having an affair with this woman? If he hotly denies it, tell him that you do not want to be suspicious, but even he would have to admit that those messages make it LOOK like he was interested in this other woman.
The ball is in his court at that point. I would not forbid him to speak to her or anything - that will backfire against you and besides, HE needs to be the mature one who can rein in his feelings to an appropriate level. I would ask that he send her a message saying that he feels their conversation got off track and while its great to talk with her and reminisce, that he really went a little too far flirting and he doesn't want to be anything but friends.
Good luck- don't let yourself be nervous- it is an awkward situation, but it sounds like you can head it off before real damage is done to your marriage!