NEW YORK ( TheStreet) -- Shares of Amazon (AMZN) - Get Report topped the S&P 500 on Friday with a 10% gain after posting a surprise profit during the second quarter. The stock is TheStreet's Move of the Day.

Earnings a share came in at $0.19, while analysts polled by Thomson Reuters expected a $0.14 loss. Revenue totaled $23.2 billion - a 20% year-over-year jump, and above the $22.4 billion analysts were looking for.

The blowout quarter was driven in part by strength in Amazon Web Services, its cloud business.

Sales in the division totaled $1.82 billion, an 81% rise over the past year. This is the second quarter where Amazon provided specific revenue numbers on this part of its business.

"There are seasonal fluctuations in the business and investment cycle fluctuations in the business, but I would say that probably over the next several quarters we should be seeing year over year improvements in profitability and a more profitable business," said ITG analyst Steven Weinstein in an interview with TheStreet. "Things will ebb and flow, but it seems as though the progression is improving profitability."

As for guidance, the Seattle-based e-commerce behemoth expects third-quarter revenue in the range of $23.3 billion to $25.5 billion, a 13-24% year-over-year jump.

It does expect a loss in the range of $480 million to a profit of $70 million.

The analysts at RBC Capital Markets held an outperform rating with a price target of $650.

UBS analysts maintained a buy rating with a price target of $650. The analysts at Credit Suisse held an outperform rating with a $700 price target.

Shares of Amazon rose 72% since the start of the year.