In the movie X-Men: First Class, a prequel in which we meet the younger, more innocent versions of the characters from the later movies, the ever-wise and telepathic Charles Xavier (later known as Professor X) coaches Erik -- the vengeful, angry young man who will eventually become his arch-rival, Magneto -- on how to use his metal-bending superpower. Erik cannot seem to unleash the full extent of his power except when he is swept away by emotion -- specifically, anger and sorrow. Xavier instructs him on how to control his mind in order to control his power: "True focus lies somewhere between rage and serenity."
Like most dialogue in superhero movies, this line is too cute by half, but within it there is a kernel of truth. From the Buddhist point of view, the key to working skillfully with our emotions -- both the pleasant ones and the painful ones -- is to find a balance between, on the one hand, feeling the emotion and opening to its energy, and on the other hand, having enough space around the experience of the emotion that we do not get swept away by it. It's rather like the way the Buddha instructed one of his students who was struggling with meditation practice: "Not too tight, not too loose."
In the Vajrayana Buddhist tradition, and particularly in the view of "formless" meditation practices like Mahamudra and Dzogchen, whatever arises in the mind -- even powerful, afflictive emotions such as anger, jealousy, or rage -- is regarded as the path of awakening. We don't need to apply any antidotes, or try to get rid of our thoughts or pacify our emotions. Every experience is the play of mind's natural luminosity and emptiness. The only question is how we relate to what arises in our minds -- whether we see its true nature or mistake it for something it is not.
Usually we cling to the thoughts and emotions that make us feel good or reinforce our egos, and we reject and push away the ones that feel unpleasant. Or, like Magneto, we go the opposite way and cling to what is actually painful; we nurse resentments and keep scratching at wounds that eat us up from the inside and become the whole storyline of our lives. In either case, we project a degree of reality and solidity onto our thoughts and emotions that they don't really have. As Khenpo Tsultrim Gyamtso Rinpoche said, "When you know that thoughts are illusions, you can take thoughts of desire and anger as friends." The stronger the emotional charge, the more it reveals or points to mind's awakened nature. It all depends on whether we can experience the raw energy of our emotions without buying into our own concepts and storylines about them, and without blowing our emotions up into something they are not.
The story of how Erik became Magneto is, of course, a cautionary tale. In the end, Erik was just too consumed by his rage and his thirst for vengeance, and his obsession turned him to the dark side. From Charles Xavier he learned how to unleash his full mutant powers, but not how to let go of his own concepts. He didn't quite grasp the real meaning of Xavier's advice about working with the power of emotions: "True focus lies somewhere between rage and serenity." In other words, it's about finding the middle way.
I think Professor X was on to something. He might even have been studying Buddhism.