Good question. The first thing that comes to mind is don't collapse in on yourself. If you feel your head lowering, shoulders hunching forward, spine collapsing inward, then you are creating a defensive barrier that will trap emotions into your body instead of letting them out. This will cause your body to form bad habits that lock your muscles, bones (and emotion) down, limiting range of motion and breath.
Every situation is different. I once was in a situation where he had simply reached his emotional breaking point. So he was yelling things along the lines of "I'm sorry! I'm such a baby! This isn't supposed to be dramatic!" In this case my goal was simply to comfort him. Yelling during a fight is not always a sign of aggression. Sometimes it's necessary to release trapped emotions.
If your partner is yelling to attack you, with the intention to hurt you, realize that you are not the only thing in their life. Chances are that they have many things building up inside of them and whatever happened between the two of you was simply the catalyst.
As far as how to react, that also depends on the person. If you want to yell, then yell. Let the emotion out. Whatever your reaction is, make sure it is one you would feel comfortable justifying to friends, family, and most importantly your partner at a later time.
Your partner should not attack or hurt you, verbally or physically. If they are, then they are using your generosity and selflessness to exercise their anger and frustration. This is not healthy in a relationship. Whether your response is anger or fear, make sure that you allow yourself to get what you need from the fight. Sometimes we need to yell so that we can then keep our cool. It's a little counterintuitive but if you are shoving down emotions and locking down your body, you are not keeping your cool.