Hey - a lot of us have been there!
It happened to me when I was at college and my g/f was about 200 miles away working. My housemate was in a similar position (his g/f lived in Italy) and we got hammered one night, crashed out on his bed, got horny and he ended up pulling his cock out to jack off (apologizing to me in the process) because he couldn't hold back any longer. I ended up taking over for him, as he lay back with his eyes closed, and I finished him off. It happened on a few more occasions after that, usually after we'd been drinking, but never more than us wanking off together or giving each other a handjob.
Eventually we decided that it wasn't a good idea and that we needed to resist the temptation of easy gratification and stick to satisfying ourselves once we'd gone to bed. Nevertheless, I have no regrets about seeing the look of ecstasy on my mates face as he reached that magic point of no return and of knowing that I was able to provide him with that pleasure a few times.
Things were a bit awkward between us for a few weeks. We talked about it at the time but it's never been mentioned since. I still see him, his wife (now ex-wife) and daughter occasionally and it's long forgotten, so your friendship can endure.
The best thing to do is to talk to him about it, apologize to him if he felt that things went too far, stress to him that you really value his friendship and just put it behind you. That's not to say that it might not happen again in similar circumstances if you both want it to - but if one of you doesn't then you've got to respect the other ones point of view and hold back, however difficult that is - even if you are the one that doesn't want to do it again and he comes on to you. If you are both happy to do it again then that's fine and up to you - just make sure that you both know the other's boundaries, so that you don't overstep the mark and end up damaging your friendship.