It was a great first half of the year for many investors, as the market, as measured by the S&P 500, was up by about 10%. The health-care sector led the way, appreciating by 19.1%. Even investors in slower-growing sectors such as utilities (up 7.7%) and energy (up 8.6%) did well.

But even though all sectors were positive, not all investors felt the market's lift evenly. The one sector that wasn't very kind to investors was the materials sector, which squeaked by with the lowest appreciation at 1.7%. Many stocks in the sector simply got crushed. Let's look at what went wrong.

Hint: Following the yellow brick road didn't lead anywhere good. Source: Gold Footpath by George Hodan.

Gold stocks have been hit particularly hard so far this year. Investors in gold miners such as Goldcorp (GG) and Yamana Gold (AUY) have been crushed, with the stocks down by 34% and 45%, respectively. The big culprit here is that gold has completely lost its luster with investors. The shiny metal fell to a three-year low of under $1,200 an ounce. In the second quarter alone, the price of gold dropped by more than $400 an ounce, a 25% plunge. The following chart shows just how bad it's been for gold miners.

AUY Chart

AUY data by YCharts

Gold investors weren't the only ones having a rough year. Other commodities such as silver and copper have been sinking this year as well, sending top stocks such as Silver Wheaton (WPM 1.48%) and Freeport McMoRan (FCX -2.28%) down by double digits. Again, looking at the chart, you can see a pretty big correlation between falling commodity prices and the subsequent fall in the price of each stock.

New York Silver Price Chart

New York Silver Price data by YCharts

Many of these companies were hit by a one-two punch, as falling commodity prices were magnified by company-specific issues. Freeport, for example, spent most of the year working to close its transformative oil and gas deals. The company was also hurt by a collapse at one of its top mines, which forced it to shut down production. Meanwhile, Goldcorp endured project start-up delays at its Cerro Negro mine in Argentina. Even silver streamer Silver Wheaton was hurt by a project start-up delay as the company, which has a silver streaming agreement for the Pascua-Lama mine in Chile, was hit by that mine's water issue delay. The mining industry as a whole has been riddled by both cost overruns and start-up delays, which have really hit profits and taken stocks down with it.

Company-specific issues were the main culprit behind the really rough first half for iron ore and metallurgical coal miner Cliffs Natural Resources (CLF -11.10%). The company was down by a nausea-inducing 58% in the first half after slashing its dividend by 76% and raising equity capital to shore up its balance sheet amid slumping profits. A big factor here is that the company was also forced to write down about $1 billion of goodwill related to its Consolidated Thompson acquisition. The company has a long road to recovery ahead of it.

Given the precipitous fall in gold prices, gold miners also have a long recovery ahead. Many, including Goldcorp, have based business decisions on a long-term price of gold north of $1,350 an ounce, which could mean project delays or more write-offs. That's causing many miners to look at cutting costs, with companies such as Yamana working hard to lower overhead costs as well as cut higher-cost production. Until the price of gold finds a firm bottom, investors in these companies could be in for a bumpy ride.

At some point, all of these commodities will be back in favor with investors, because supply and demand always seems to ebb and flow. That doesn't mean you can't do well by getting in early, if you have a very long-term time horizon. But the bottom line for investors is that you should continue to expect volatility until many of these commodities hit bottom.