Joy Global was the worst performer in the S&P 500 in the third quarter. Image source: Joy Global.

After years of nearly straight-up movement for the stock market, the S&P 500 (^GSPC -1.28%) finally suffered a correction during the summer months, ending the third quarter down more than 140 points and resting almost exactly 10% below its all-time record levels. More than two-thirds of the index's 500 stocks posted losses for the quarter, but five companies in particular were especially problematic for the benchmark, all losing 45% or more. Let's take a closer look at what hurt the S&P so much over the past three months.

Energy and commodities get crushed
It should come as no surprise that the three worst-performing S&P stocks of the quarter have ties to the energy and commodities industries. Joy Global (JOY), which fell 58% for the quarter, has long struggled under the weight of the ailing mining industry, with its sales of mining equipment to key producers having suffered from a lack of demand. Miners simply don't have the cash flow necessary to make big capital expenditures right now, and so heavy-equipment sales from the key sector have had a huge impact on Joy Global's sales.

CONSOL Energy (CNX -1.53%) has felt a more direct impact from energy's recent weakness, as the company's strategy to diversify itself out of the coal business has proved prescient but nevertheless difficult to implement successfully. Sales of its coal mines in late 2013 helped CONSOL shift toward natural gas, and with utility customers moving toward the cleaner-burning fuel, CONSOL seemed well-positioned to transform itself. Yet low natural gas prices have hurt CONSOL's profitability, and the company still has coal assets that are also weighing down its future.

Finally, Freeport-McMoRan (FCX 0.96%) lost 48% during the quarter as it had to deal with a double hit from energy and commodities. Copper prices fell to their lowest levels in years during the summer months, and Freeport's 2013 acquisition of oil exploration and production businesses left it exposed to the plunge in crude oil as well. Investors have had to deal with Freeport's need to raise cash by making dilutive stock offerings and considering a partial sales of its oil and gas business so soon after having acquired them, and with the company's mining operations faring little better, Freeport stock remains under pressure.

Betting big
Beyond energy, a couple stocks stood out as big losers for the quarter. Wynn Resorts (WYNN -0.60%) plunged 46% as conditions in the Asian gaming capital of Macau have stayed ugly. Big declines in revenue in Macau have stemmed largely from the near-disappearance of VIP junket-based gamblers, with charges of corruption and theft raising calls for greater regulation that threaten what in the past has been the biggest source of business for many gaming companies. Like some of its peers, Wynn has a new resort property scheduled to open in the near future, but the slump has called future plans for players throughout the industry into question as investors wait for clarity from Chinese gaming officials.

Finally, Mallinckrodt (MNK) was also down 46% during the summer months. The drugmaker saw substantial gains in sales and profits in its most recent quarterly report, due largely to its acquisition-based strategy. Yet the company cut its forecast for sales of its key drug Acthar, raising concerns about the sustainability of the franchise even after Mallinckrodt had spent $5.6 billion just last year to buy Acthar marketing company Questcor Pharmaceuticals. More broadly, weakness in the biotech industry has rubbed off on Mallinckrodt shares. Unlike most of the rest of the poor performers in the S&P 500, though, Mallinckrodt still stands 50% higher than it traded just two years ago.

The S&P 500 has had a tough quarter, and these stocks in particular have seen a lot of pain. For the market to recover, investors will need to see companies like these five find new ways to boost their profitability and seek out new growth opportunities. Otherwise, the correction could last a lot longer than most expect.