The second quarter was terrible for gold miners as gold's price plunged 23%. That took gold mining stocks down with it as seen in the following chart:

AUQ Chart

AUQ data by YCharts

What's worse, as these companies were dealing with gold's sell-off, many were also dealing with higher costs to extract gold. Needless to say, that really hurt profits.

When AuRico Gold (NYSE: AUQ) announced its preliminary operational results on July 16, the company showed that total cash costs per ounce of gold were up from $635, to $655, quarter over quarter. This pushed the company's first half total cash costs to $645 an ounce, which is at the top end of its guidance range for the year. With gold prices slipping, rising costs is not something investors enjoy seeing.

One area AuRico investors should monitor moving forward is the progress of the company's Young-Davidson mine shaft and hoisting system. This project is expected to produce some unit-cost efficiencies. Given that this is the company's most expensive mine, addressing this in a timely fashion is critical. Last quarter, gold from Young-Davidson cost $716 an ounce, which was well above the company's guidance of $575-$675 an ounce. Expectations are for this project to be operational in September of this year, which should help to get this mine's costs better in line with the company's expectations.

AuRico wasn't the only miner to see its costs rising. Goldcorp (GG) saw its cash costs soar to $646 per ounce this past quarter, which is up from just $565 an ounce the prior quarter. The company does see this as temporary, as it reaffirmed guidance of cash costs of $525-$575 an ounce this year. This is an area that investors still need to watch, as rising costs will really cut into its profits if gold prices slump again.

In the near term, one company to watch is Barrick (GOLD 3.39%). Last quarter, the company reported cash costs of just $561 an ounce, which is well below its guidance of $610-$660 an ounce for the year. It will be interesting to see if the company can maintain below guidance costs or if it, too, will be hit by higher gold costs in the quarter, as well. If the company beats estimates, its likely because it kept costs down.

Last quarter was a rough one for gold investors. Higher costs, when combined with lower realized prices, don't have a positive effect on a company's bottom line. That's why those companies that are able to keep costs down will thrive.