Feel bad for yelling at my son

My son is 7 years old and over all a great kid. However he is very argumentative especially when I help him with homework. He will fight it every step of the way which makes the process long and frustrating. Tonight he became so angry he yelled in my face. This angered me so I very loudly yelled at him not to talk to me that way and sent him to his room. I saw the shock and fear in his face when I did. Now I feel guilty. Did I handle that terribly? Should I apologize for getting so loud or should I not? What would you do in that situation?