What happened

Shares of fertilizer company Intrepid Potash (IPI 0.08%) rose nearly 18% today after reporting solid progress in the second quarter of 2017 and capping off a pretty good first half of the year. Although sales are down, the company's bet on lower-cost solar production is resulting in improved gross margin and cash generation. Then again, the company is still losing money.

But things are heading in the right direction. In fact, if you reach back one more quarterly period, the company has reduced its debt by 54% in the last nine months. A stronger balance sheet will be important for continuing to survive the current down cycle -- and take advantage of opportunities when the market turns around.

As of market close, the stock had settled to a 17.8% gain.

A woman checking her smartphone and pumping her fist in the air as $20 and $50 bills fall around her.

Image source: Getty Images.

So what

Here are the highlights from the company's first six months of 2017 compared to the year-ago period:

Metric

First Half 2017

First Half 2016

Percentage Change

Revenue

$92.2 million

$125.1 million

(26.3%)

Cost of goods sold

$65.6 million

$101.6 million

(35.4%)

Operating income

($11.3 million)

($27.0 million)

N/A

Net loss

($19.6 million)

($31.8 million)

N/A

EPS

($0.19)

($0.42)

N/A

Shares outstanding

104.2 million

75.8 million

37.5%

Average selling prices, potash

$238 per ton

$206 per ton

15.5%

Average selling prices, Trio

$200 per ton

$318 per ton

(37.1%)

Source: Intrepid Potash.

A couple of things stand out from the table above. First, Intrepid Potash only has managed to pay down its debt by issuing more shares, which has resulted in significant dilution in just the last 12 months. Management thinks that was a necessary evil. Investors may or may not agree, but the company is controlling the things it can, such as production costs. It cannot control selling prices.

Second, selling prices for its Trio-branded products have fallen substantially in the last year, while potash prices have risen slightly. Unfortunately, Intrepid Potash increased production of the former and (significantly) reduced production of the latter.

Now what

There's not a whole lot more management can do right now to combat a historically weak market. Production costs have fallen by relying more heavily on solar-evaporation ponds to purify potash products. Selling, general, and administrative costs -- which weren't very high in the first place -- have been reduced by about 20% in the past year. The company is definitely moving in the right direction, but if selling prices don't allow much higher margins soon, then the stock could continue to struggle.