Source: J.C. Penney.

J.C. Penney (NYSE:JCP) stock rose by more than 16% on Friday after the company delivered a truly impressive earnings report for the first quarter of fiscal 2014. Penney is clearly moving in the right direction, and the stock still offers substantial room for gains when comparing its valuation against that of stronger peers such as Macy's (NYSE:M) and Kohl's (NYSE:KSS). The company may not be out of the woods yet, but its current performance is certainly encouraging.

J.C. Penney delivers
Sales during the quarter ending on May 3 increased by 6.3% to $2.8 billion, versus $2.6 billion in the same period of 2013. This was better than analysts' estimates of $2.7 billion for the quarter. Furthermore, same-store sales increased by 6.2% during the quarter, which was above the company's own guidance for an increase of between 3% and 5%.

Even more important, profit margins increased by 230 basis points to 33.1% of sales versus 30.8% of revenues during the same quarter in the prior year. Gross margin during the quarter ending on Feb. 26 was 28.4% of revenues, so margins are also moving in the right direction on a sequential basis.

SG&A expenses for the quarter were down $69 million to 36.0 % of sales, representing a 490-basis-point improvement year over year. The company is still losing money on an operating level, but the total operating loss was reduced by 49.2% versus the same period in the prior year, coming to $247 million.

Net loss came in at $1.16 per share, materially better than the net loss of $1.25 per share forecast on average by Wall Street analysts.

The company announced that it has secured a new $2.35 billion credit facility to replace its existing $1.85 billion bank line. Management expects this facility to provide better pricing terms and to add $500 million in incremental liquidity.

Management is expecting comparable-store sales to increase in the mid-single digits during both the coming quarter and the full year 2014. Gross margins are also forecast to continue rising in the medium term, so the company believes it will continue improving over the rest of the year.

In the words of CEO Mike Ullman:

This year, we began progressing through the go-forward base, and I'm pleased to report we're making excellent progress. And I believe the results we announce today demonstrate the case. During this phase we're focused on refining our merchandizing and marketing strategies and are to steadily grow sales and significantly improve gross margins while continuing to tighten and manage our expenses, all with an eye toward returning to profitable growth.

Upside potential
J.C. Penney is not definitively out of the woods yet; the company is still losing money, and a highly leveraged balance sheet means that there is not much room for mistakes. On the other hand, J.C. Penney has come a long way over the last few quarters, stabilizing sales and generating considerable improvements in profitability.

It's important to remember that when comparing J.C. Penney against competitors such as Macy's and Kohl's the stock still offers plenty of upside potential if management continues leading the company in the right direction.

Both Macy's and Kohl's are in much sounder financial positions than J.C. Penney, so they deserve a valuation premium. However, the difference in valuation is still quite big: J.C. Penney trades at a price-to-sales ratio of 0.22, materially lower than the price-to-sales ratios of 0.89 and 0.7 for Macy's and Kohl's, respectively.

If the company continues increasing sales and margins over the coming quarters, the stock has a lot of room to run from current valuation levels.

Data source: FinViz.

It's also worth noting that Macy's and Kohl's announced weak sales performance during the last quarter due to challenging industry conditions.

Macy's announced a decrease of 1.7% in total sales during the quarter ended on May 3, hitting $6.3 billion, while comparable sales, including departments licensed to third parties, fell 0.8% versus the prior year. Macy's generated a gross profit margin of 38.9% during the quarter.

Kohl's delivered a decline of 3.1% in total sales to $4.07 billion, while comparable-store sales fell by 3.4% during the quarter. Gross margin was 36.8% of sales, a moderate increase versus 36.4% during the same period in 2013.

Considering the heavy industry headwinds affecting competitors such as Macy's and Kohl's during the last quarter, J.C. Penney's performance looks even more impressive.

Foolish takeaway
J.C. Penney is still a risky proposition for investors, but the company is making remarkable improvements when it comes to both sales and profitability. Furthermore, the stock still offers substantial upside room in comparison to competitors like Macy's and Kohl's. Investors in J.C. Penney have solid reasons to feel reassured by the latest earnings report.

Andrés Cardenal has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.