I agree with what others have said, time outs can be effective, and seems appropriate in the context, and you should not feel bad about him crying.
I always give my kid a hug and 'I love you' after a time out - talking to him making clear his behavior was bad, but he is not a bad kid.
In addition, I would suggest that you talk to him about appropriate outlet for his feelings/expressions. Since he can't talk, it might be something like:
Walk away from your friend when you are angry, or go hit a pillow - whatever you feel is appropriate in your house. I think that kids that age cannot be expected to be calm all the time, they have lots of feelings and it can be very frustrating not to be able to express them when they don't have words, or don't have the calm to use them. I think it is ok to show anger and frustration in an appropriate outlet, and it can even be physical (as in hit your bed or a pillow).
We also had an issue with our oldest where he would get very excited and push/hit other kids. Not maliciously, wanting to harm them, but not by accident either. We talked to him about in context of being 'excited' - I think that he really wanted to play with them, or he just didn't think about their feelings (remember other people are not really people to a 2 year old, empathy is hard).
We taught him when he was playing, and got too exited he is supposed to clasp his hands together and take deep breaths. It really helped! Now he is older we tell him to count to 10.
I, myself, gets easily upset and unbalanced, and I was really quite often frustrated with no way of calming myself as a kid. I wasn't really given any tools by my parents and teachers, so I want to start early to give my kids tools to calm themselves down.