The 'Middle Way', avoiding the extremes of self-indulgence and self-mortification, is the path which the Buddha taught in the Fourth Noble Truths that leads to the complete cessation of suffering (dukkha) and release from the cycle of existence (samsara). This is the realisation of Nibbana, the ultimate goal of a Buddhist.
The path comprises eight categories or factors which aim at developing and perfecting the three essentials of Buddhist training and discipline: Virtue (Sila), Concentration (samadhi) and Wisdom (panna).
Virtue or Ethical conduct comprises Right Speech, Right Action, Right Livelihood, and Right Effort.
Concentration is the development of Right Mindfulness and Right Concentration through meditation.
Wisdom comprises Right Understanding and Right Thought.
What the Buddha meant by 'Right' is that which produces a beneficial result.