In baseball, an unearned run is a run which is scored either directly or indirectly due to a fielding error.
The concept of earned and unearned runs emerged in the 1890s during more stringent formulations of the game, when defense was a much more erratic part of play. Runs caused by errors were fairly common, due to poor equipment, unkept fields, and a generally looser and more raucous playing atmosphere.
In the modern version of baseball, unearned runs are calculated by removing all errors from an inning and then determining if a run still would have scored.
Thus, if a batter hits a ball which is dropped (and therefore ruled an error) and then proceeds to score, that is an unearned run.
Also, if Batter A gets on base with 2 outs, and then Batter B hits a ball which is dropped (and is ruled an error), and Batter A scores on the play, then Batter A's run is ruled unearned because Batter B's ball would have been the third out, and the run would not have scored.
These are the two most common forms of unearned runs, but there is a third, much trickier, variation on unearned runs:
If a runner scores on an error, and then the inning ends before that runner would have scored without the error, the run is unearned. So if a runner is on 3rd base, there is a passed ball (an error by the catcher), and the runner scores, and then the batter proceeds to strike out and end the inning, that run is unearned. However, if the batter hits a home run, then the run is considered earned, because the runner would have scored without the aid of the error. In all of these rulings, the theoretical bases advanced on any hit are calculated by giving full benefit to the pitcher.
The unearned run is part of a number of interesting stories surrounding baseball, but perhaps its most central appearance was in 1990, when Andy Hawkins of the New York Yankees proceed to throw 8 innings of a no-hitter - and lost the game 4-0, on 4 unearned runs, all the result of 2 errors by his teammates in the 8th inning.
Today, sabermetrics has a number of formulae which deal with unearned runs, including DIPS, or "Defense Independent Pitching Statistics", which includes unearned runs in its calculations, and the URA, or "Unearned Run Adjuster", which compares teammates' unearned runs to compensate for luck and each pitcher's individual tendencies.