Euripides' Medea, first staged in 431 BCE, was one of the most horrifying plays to come to the ancient Athenian theater. In the play, Medea is responsible for the deaths of Creon, Creon's daughter, and her own two children by Jason.
On one level, it is difficult to find any excuse for Medea's actions. Even though Jason divorced her, Medea had arranged for protection with King Aegeus of Athens after leaving Corinth, so there was no issue of Medea being "cast out into the cold" with nowhere to go. Additionally, Medea's children are completely innocent and so killing them is morally reprehensible.
From the perspective of the mythic tradition, Jason survives his encounter with Medea and so to have Medea kill Jason would have run counter to the established tradition. So, that sort of revenge would not have been "right" from that perspective.
Although in my view Medea's actions are in no way "right" in a moral sense, her revenge on Jason could be seen as "perfect" if we take this word to mean "complete" or "whole." So, if by "perfect" we mean "complete," then I would say Medea's revenge is "perfect."
Medea kills the children that she has had by Jason, so Jason no longer has male heirs (the ancient Greek version of a 401k plan). Medea kills Jason's new bride, so he cannot produce heirs by her to replace his dead sons. Medea also kills Creon, so Jason is not going to be able to inherit his kingship. Finally, Medea leaves Jason alive to carry out the rest of his wretched existence with the memories of how Medea, in a matter of minutes, wiped out everything he loved and everything he dreamed of.
Perfect? Only in Medea's mind. "The right way?" That depends on the definition of "right" you are using. It was probably the most effective for Medea, as it is the solution that would hurt Jason the most, as well as getting rid of daily reminders of him. It is definately the most horrific for the reader, also, as most people could not even imagine thinking of such a revenge. It helps the reader know just how mentally unbalanced Medea really was. Jason would deserve the reader's scorn for straying from Medea and marrying someone else. But the true "bad guy" is definitely Medea for her choice of revenge. If Medea's revenge would have stopped with just the burning coat, the reader might feel the revenge was "right." In killing the children, the revenge is taken to the extreme so that Medea would be seen as someone who deserves no sympathy.