After months of calm, steady gains, volatility is back with a vengeance. In the past two days, the stock market has earned back a good portion of the ground it lost in the previous week, as investors have apparently started focusing more on the positive factors supporting stocks. When all was said and done, the Dow Jones Industrial Average (INDEX: ^DJI) picked up another 181 points to finish at 12,987.

As usual, though, some stocks had a bigger impact on the market than others. Let's look at three of the Dow's stocks that posted some of the best gains on Thursday.

Hewlett-Packard (NYSE: HPQ), up 7.2%
HP has been looking for a turnaround success for a long time. Today, the company finally got one.

A report from IDC noted that HP's worldwide market share rose from 16% in the fourth quarter of 2011 to 18% in 2012's first quarter. In the U.S. market, the gains were even more dramatic, to 28% from 23%. The news doesn't change the fact that PC growth overall is far slower than it was before tablets came on the scene, but for HP investors, it provided a much-needed confidence boost as the earnings season begins.

Caterpillar (NYSE: CAT), up 4.6%
Whenever enthusiasm for the global economy picks up, you can expect Caterpillar to join in the celebration. But the big number for the equipment giant will come tomorrow, when China announces its latest GDP figures.

If Chinese growth comes in better than expected, then the bull case for Caterpillar will remain intact. As emerging-market growth has been a huge catalyst for Caterpillar's gains in recent years, the company should thrive as long as that trend continues.

Bank of America (NYSE: BAC), up 3.5%
Similarly, renewed optimism about Europe's prospects tends to boost shares of big banks like B of A. But Wall Street faces its own day of reckoning soon, as Wells Fargo and JPMorgan Chase start off bank earnings season tomorrow morning.

For B of A's part, earnings expectations are fairly restrained, with expected EPS of $0.12 representing almost a 30% decline from last year's levels. But that low hurdle presents an opportunity for B of A -- and it's one that the bank can't afford to squander, as many wonder whether it can recover as strongly as peers such as Wells and JPMorgan have.

Keep on movin'
As the roller-coaster ride in the stock market continues, you can't afford to get caught up too much in the day-to-day moves among individual stocks. Long-term investors benefit from not having to worry about every little move in the markets. To get some promising stock ideas that work well for long-term investors, take a look at The Motley Fool's special report on stocks to help you retire rich. But don't wait; get it free today before it's gone forever.