What: Shares of consumer electronics retailer Best Buy (BBY -0.81%) surged on Tuesday after the company reported its second-quarter results, handily beating analyst estimates across the board. At 11:50 AM Tuesday morning, the stock was up about 14%.

So what: Best Buy reported quarterly revenue of $8.53 billion, up 0.8% year-over-year and $240 million higher than the average analyst estimate. Overall, Best Buy reported comparable-store sales growth of 3.8%, with online sales surging 17% year-over-year. Weakness in the international segment, which saw revenue decline by 25%, was more than offset by growth in the much larger domestic business.

Best Buy reported non-GAAP EPS of $0.49, up 16.7% year-over-year and $0.15 higher than analysts were expecting. On a GAAP basis, EPS was $0.46, up 18% year-over-year. Gross margin in the domestic segment expanded to 24.7% during the quarter, up from 23.4% during the same quarter last year, while operating expenses as a percentage of revenue grew year-over-year due to investments in Best Buy's growth initiatives.

Looking forward, Best Buy expects the third quarter to be more challenging. The company guided for flat to negative low-single digit revenue growth, with operating margin expected to be flat to down 20 basis points. Best Buy tends to give very conservative guidance, so investors shouldn't be surprised by the apparent pessimism baked into the company's outlook.

Now what: Best Buy's turnaround efforts continue to gain momentum, with revenue growing, margins expanding, and the e-commerce business performing well. For the 13 weeks ending Aug. 1, NPD reported that consumer electronics sales industrywide declined by 1.3%. This suggests that Best Buy is winning market share in a very difficult environment.

The progress of Best Buy's transformation from a struggling retailer left behind by the rise of e-commerce to a more nimble, omni-channel retailer can be seen in its results. It's been a bumpy ride, and Best Buy certainly has plenty of work left to do, but the company is executing on CEO Hubert Joly's strategy, and investors clearly like what they see.