The solar market continues to be a tough slog for panel manufacturers. Competition from China is fierce and there's a huge oversupply of modules in the industry. But two American companies are slowly separating themselves from the pack: First Solar (FSLR -2.40%) and SunPower (SPWR -2.32%).

Looking at the price action of both stocks today you wouldn't think we're seeing any progress at all. In fact, with First Solar down 9% and SunPower down 5% it would seem that the numbers were downright dreadful. Well, here's what's really going on.

The numbers
At First Solar the company generated $839 million in revenue and earnings per share of $1.00, or $1.27 if you take out restructuring charges. Analysts had expected earnings of $1.04 per share (excluding restructuring) so it looks like a solid quarter.

Revenue numbers and operating cash flow were a little lower than expected but this was mostly due to changes in the timing of completed projects. Revenue and cash flow at both First Solar and SunPower can swing wildly quarter to quarter depending on when projects are sold to customers, so I wouldn't worry too much about a delay or two.

At SunPower, revenue was $649 million and net loss fell from $84.2 million a year ago to $48.5 million, or $0.41 per share. When you strip out one-time items like a big goodwill write-off the company made $0.03 per share, far exceeding the $0.11 loss analysts expected.

So numbers weren't outstanding but they largely exceeded expectations, and given the backdrop of the current environment in solar they seem pretty darn good. So what's going on with the market today and what should we expect going forward?

What's really going on
I don't worry too much about expectations from analysts or revenue swings here and there, so a lot of the market's reaction doesn't faze me. But there are some numbers I think are important, and despite Wall Street's reaction we're actually seeing progress.

SunPower reported pretty steady gross margins on a GAAP and non-GAAP basis of 12.4% and 14.1%, respectively. That's good but when we dig down into regional gross margin we see that the Americas region generated a margin of 20.2% and APAC was at 21.4%, both increases from last quarter and a year ago. Its no surprise that Europe was a huge drag and kept margins from moving even higher.

First Solar's gross margin improved for the second consecutive quarter to 28.4%. That's far and away the best margin in solar.

First Solar is also steadily making improvements in efficiency. Conversion efficiency is up to 12.7%, up 0.1% sequentially and 0.9% annually.

On the cost side, First Solar said that total cost per watt fell $0.05 sequentially to $0.67. SunPower doesn't release exact cost per watt numbers but CEO Tom Werner said that the company was on plan to reduce cost by 25% this year.

Separating themselves
If First Solar and SunPower are going to continue separating themselves from top competition in China like Trina Solar (NYSE: TSL), Yingli Green Energy (NYSE: YGE), and Canadian Solar (CSIQ -3.44%) they will have to lower costs, increase efficiency, and improve margins. Indications are that both companies are making strides in all three areas.

The numbers from SunPower in the U.S. are also encouraging because the U.S. is a far more sustainable market than Europe was at a similar point in its growth phase. The company also said that shipments to Japan increased 30% sequentially and generated 10% of sales. Both of these companies are critically important because they're sustainable markets that have huge potential. They're also more difficult for Chinese competitors to enter because of trade challenges.

At First Solar, the company's strategy to focus on projects in sustainable markets is paying off. The company currently has a 3-GW system pipeline and new projects are increasingly coming from places in Asia where solar is just beginning to grow.

Foolish bottom line
Both First Solar and SunPower may be trading lower today but I'm seeing steady progress toward both companies being long-term winners in the solar industry. The countries that are most profitable are the ones that are growing the fastest right now and if China begins to curb its unprofitable expansion in solar we could start to see sustainable profits in the next year or two.

It's still wise for investors to take a cautious approach but I think these two stocks have turned the corner and their best days are ahead.