My best guess was that he was having a bad day. You witnessed part of it. Did your friend overreact? SURE! Perhaps more was going on with him than you were aware of. Either way, sounds like you've forgiven him already.
If you want to save/strengthen your friendship, take him out to eat, or just bring some food over and have a sit down. Dont worry about getting anything fancy. Spend as much or as little as you can afford. Apologize for pissing him off and let him know you forgive him for getting so angry. Tell him that you were just joking around like the 2 of you always seemed to do, and ask him, "Next time if I am going too far to just let me know to back off. Blowing up like you did without warning is going to make it hard to be friends."
Of course you are going to actually have to back off if he asks you to. On the other hand, you have also set up a rapport such that if he is really pissing you off you too can say "hey man, knock it off."