On Wednesday, Macy's (NYSE:M) stock tumbled 16%, even though the company posted sales and earnings results that beat management's expectations. Investors appeared to be disappointed that comparable store sales rose just 0.5%, even though comp sales growth would have been closer to 3% absent a shift in the timing of a major sale.

Yet Macy's second-quarter results look downright phenomenal when stacked up against the dreadful earnings report that J.C. Penney (OTC:JCPN.Q) released Thursday morning. The struggling department store chain continues to suffer from weak sales and margin erosion. As a result, J.C. Penney slashed its full-year guidance and now expects to record a big loss for fiscal year 2018.

The high-level numbers

In the first quarter of fiscal year 2018, J.C. Penney logged a disappointing 0.2% comp sales increase, which it blamed on unfavorable weather trends. However, management noted that sales trends improved significantly starting in late April. With that in mind, I argued earlier this week that more seasonable weather, strong retail sales trends, and competitors' store closures probably allowed J.C. Penney to post a much stronger sales performance in the second quarter.

I was dead wrong. J.C. Penney's comp sales rose just 0.3% last quarter. Total revenue fell 7.8%, largely due to the impact of nearly 140 store closures that J.C. Penney completed late in the second quarter of 2017.

Meanwhile, gross margin plunged to 33.7%: down 1.6 percentage points year over year. This was particularly disappointing given that clearance sales related to last year's store closures had caused 2 percentage points of gross margin erosion in the year-earlier period. In just two years, J.C. Penney's Q2 gross margin has fallen from more than 37% to less than 34%.

The exterior of a J.C. Penney store.

J.C. Penney posted weak sales and earnings results for the second quarter. Image source: J.C. Penney.

With soft sales and weak gross margin, J.C. Penney posted an adjusted loss of $0.38 per share for the second quarter, down from a $0.07-per-share loss in Q2 2017. The company expects its weak trends to continue. For the full year, it now projects that comp sales will be roughly flat, compared to its previous guidance for a 0% to 2% increase.

To make matters worse, J.C. Penney took a hatchet to its earnings guidance. Its new forecast calls for an adjusted loss of between $0.80 and $1 per share for the full year, compared to its previous projection for roughly breakeven results. Lastly, free cash flow is now on track to be slightly positive this year, down from the previous forecast of $200 million to $300 million.

There wasn't much to celebrate

On J.C. Penney's earnings call Thursday morning, management noted that sales trends were very strong in May and July, but quite weak in June. Furthermore, part of the strength in July sales was driven by back-to-school activity beginning slightly earlier in the fiscal year.

Whereas Macy's said that shifts in the retail calendar hurt Q2 sales by 2.4 percentage points, J.C. Penney saw a 1.6-percentage-point calendar-related benefit to sales last quarter. Thus, while the two companies reported similar second-quarter comp sales results (up 0.5% versus up 0.3%), Macy's underlying trend was about 4 percentage points better.

E-commerce sales decreased last quarter, as J.C. Penney tried to cut back on unprofitable sales. Appliance sales also declined slightly, for the same reason. The only remotely positive highlight from a sales perspective was that J.C. Penney's women's apparel business finally returned to comp sales growth in the second quarter.

A J.C. Penney appliance showroom featuring washing machines, dish washers, and ovens.

Appliance sales went into reverse at J.C. Penney last quarter. Image source: J.C. Penney.

Another problem was inventory management, which has been a recurring issue for J.C. Penney. While the company had supposedly entered the year with achievable targets, it is still missing its sales targets. The interim management team is now planning dramatic inventory reductions to be carried out between now and the end of 2019, which will likely weigh on gross margin for the next few quarters.

One encouraging detail included in the earnings release is that the board has met with a number of strong candidates to fill the vacant CEO position. But it will take months or even years for a new hire to make a meaningful impact on the business.

Can J.C. Penney get back on track?

To be clear, J.C. Penney isn't doomed -- at least not yet. It is still generating enough cash to pay its bills, albeit not enough to make a meaningful dent in its substantial debt load. Additionally, most of its debt doesn't mature until 2023 and thereafter, giving the company time to engineer a turnaround.

J.C. Penney's inventory reduction initiative could also pay dividends in the long run, albeit at the cost of a lot of short-term pain. With less inventory, J.C. Penney will have more flexibility to react to sales trends and customer demand, which could drive a much-needed improvement in gross margin.

Nevertheless, it's clear that J.C. Penney's recent merchandise strategies haven't been working, and there's no way to know if a new CEO will be able to fix the damage. A turnaround may still be possible, but for now, J.C. Penney is falling further behind rivals like Macy's.

J.C. Penney stock plunged more than 20% Thursday morning, but it's not necessarily a bargain. This remains a highly speculative stock suitable only for investors willing to take on a lot of risk.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.