I think both jimjams and sofiaAmes have made some good points. If you can have this out in the open with your friend (who sounds very nice and reasonable) and agree to end a play session if your son gets hurt, then do it. But having been the 'nice' mother of a toddler hitter, I know how easily this could cause hurt.
My first son ( aged 2 - 4 ish) hit out sometimes when he got overexcited. He would aways own up afterwards. Apart from this hitting, he was a friendly and sociable little toddler and made friends easily. I tried everything to make him stop hitting and I used to dispair that he would be seen as a bully and friends would stop inviting him to play with their children. On occasion I did feel unfairly judged by my friends for my son's behaviour and it was really upsetting.
My other son now nearly 4, has (touch wood) never had a hitting problem, though he's prone to push past others and he's very lively. It makes life much easier when we meet other parents and children. But hand on heart I can say I have done nothing different with son number two. It is not my parenting skills that made son number one a hitter and son number two not a hitter.
The point I'm making is that your friend may have little real control over her son's hitting behaviour, considering his young age. Especially if the hitting is random and unpredictable, and for most of the time he plays well. And since he's only two and a bit years, he is still very young to be reasoned with and talked out of it, I think. He probably doesn't even understand what a bully is anyway, though hopefully he's grasped that hitting hurts others and is bad. I agree that removal from the situation is the best ultimate solution, perhaps the only one considering his young age.
But as Jimjams has said your friend may be more upset about his behaviour than she lets on. If someone had approached me about ending play sessions if my 2 year old son hit out, they would have had to tread carefully. I would very possibly have taken it personally as a criticism of my failure to control my son's behaviour. And would also wonder if my friend didn't like my son full stop, and that's hurtful too. So if you like this little boy in other ways, do say so lots!
I remember talking to one friend (whose son had been hit by mine) and we speculated on the causes of his hitting. She threw in the suggestion that it was because I worked full time while his father looked after him, so he didn't get enough attention from me. Ugh!
Incidently my son did grow out of his hitting phase - I don't think this was principally because of my handling of him, but was more to do with his own development.
You know your friend and she sounds reasonable. If you can imply that the problem is a joint one - sometimes your sons don't seem to get on - rather than her son causes your son problems, you can still get your message across ie if one boy hurts the other, the play session is over.
Or discuss with the mother if a temporary halt - ie taking the child into another room for five minutes - would work. Or try damage limitation and make play sessions no longer than half and hour, say. I found that if my son hit another it was often towards the end of a play session when he was at his most tired and excited.
Good luck with talking to your friend. It sounds like this is a problem you can solve in the long run.