A blue moon is an additional full moon that appears in a subdivision of a year: either the third of four full moons in a season, or a second full moon in a month of the common calendar.
The phrase has nothing to do with the actual color of the moon, although a literal "blue moon" (the moon appearing with a tinge of blue) may occur in certain atmospheric conditions: e.g., if volcanic eruptions or fires leave particles in the atmosphere of just the right size to preferentially scatter red light.
The term has traditionally referred to an "extra" moon, where a year which normally has 12 moons has 13 instead. The "blue moon" reference is applied to the third moon in a season with four moons, thus correcting the timing of the last month of a season that would have otherwise been expected too early. This happens every two to three years (seven times in the Metonic cycle of 19 years). The March 1946 issue of Sky & Telescope misinterpreted the traditional definition, which led to the modern colloquial misunderstanding that a blue moon is a second full moon in a single solar calendar month with no seasonal link.
Owing to the rarity of a blue moon, the term "blue moon" is used colloquially to mean a rare event, as in the phrase "once in a blue moon".
One lunation (an average lunar cycle) is 29.53 days. There are about 365.24 days in a tropical year. Therefore, about 12.37 lunations (365.24 days divided by 29.53 days) occur in a tropical year. In the widely used Gregorian calendar, there are 12 months (the word month is derived from moon) in a year, and normally there is one full moon each month. Each calendar year contains roughly 11 days more than the number of days in 12 lunar cycles. The extra days accumulate, so every two or three years (seven times in the 19-year Metonic cycle), there is an extra full moon. The extra moon necessarily falls in one of the four seasons, giving that season four full moons instead of the usual three, and, hence, a blue moon.