I haven’t had a boss yell at me but some direct reports have lost it with me. Best way to deal is similar to the approach from a prior PP—“let’s talk later when you’ve had a chance to calm down”, and leave. Then send an email documenting their outburst to HR, and en email to the subject giving them the inconvenient truth that they did not want to discuss civilly in person.