How do you call out a girl for being rude to another girl out of jealousy?

What can I say to defend my friend? My friend is a stunner, and the other day this other girl was trying to tell me my friend is ugly and commenting on how she must have had plastic surgery because she looks "so fake". She showed me pictures where my friend wasn't looking her best and was like "see? She's not that pretty."

I could smell a hint of jealousy, so I told her to stop being rude about my friend and be nice and that I could smell jealousy. She then told me to "be mature" and that she's allowed to say she's ugly and started arguing with me.

Could I have handled the situation differently?

How do you call out a girl for being rude to another girl out of jealousy?
Post Opinion