Analysts produce individual forecasts based on the company's prospects and trends in growth and costs before a company releases its actual earnings. If a company releases a number higher or lower than the consensus (a combination of all the released estimates), this is known respectively as a positive or negative surprise.
Positive surprises often happen at the beginning of a turnaround, or a new growth cycle where sales start to accelerate beyond the historical rates, "surprising" the analyst community.
As far back as 1968, academic studies have found a strong positive correlation between earnings surprises and stock returns, particularly if the stock reacted positively the day after earnings were announced. This is generally attributed to the fact that analysts are slow to revise their forecasts and the market does not fully react to the information about future growth conveyed by the earnings surprises.