Image source: Getty Images.

What: Gold stocks are bucking the broader market downdraft after the price of gold galloped 4.5% higher on Friday to $1,320 an ounce. Investors are taking a shine to gold in the wake of the surprising result of Britain's referendum on its membership in the EU. That rally is driving up the value of gold stocks with Gold Fields (GFI 1.38%), B2Gold (BTG 1.99%), Harmony Gold (HMY 0.69%), Randgold Resources (NASDAQ: GOLD), and IAMGOLD (IAG 6.30%) among the gold miners up at least 6% on Friday.

So what: Investors are flocking to gold-related assets because they see the precious metal as a safe-haven asset. In voting to exit the EU, Britain has created a world of economic and political uncertainty. Most economists see the decision weakening the U.K. economy in the short-term and long-run. For example, in the near-term economists at S&P Global believe that exiting the EU will shave 1% off the U.K.'s GDP next year under a "moderately severe scenario where foreign direct investment does not completely dry up." Further, S&P Global sees the move cutting economic growth in the Eurozone by 0.5%. Meanwhile, the longer-term impact could result in a loss to GDP in the U.K. anywhere between 0.1% to 7.8% by 2030 according to a range of economists.

This potential for economic weakness is fueling gold bulls, who are now growing more convinced that the U.S. Federal Reserve will not be able to hike interest rates in the coming months as quickly as it had planned to do. That is supportive of gold prices because gold does not pay holders any income and therefore struggles to compete against yield-bearing safety net assets like Treasuries when yields are rising.

Given that outlook, some analysts think gold could rise to $1,400 an ounce or more if global economic jitters persist in the wake of the Brexit news. That is certainly bullish for gold stocks, which are poised to cash in on higher gold prices.

Gold miners spent the past few years pushing their all-in sustaining costs down to improve their cash flow at lower gold prices. For example, Gold Fields lost $232 million in 2013 despite gold averaging $1,386 per ounce due in part to high all-in costs of $1,312 an ounce. However, it generated $123 million in cash flow last year even though gold averaged just $1,140 an ounce because it pushed its all-in costs down to $1,026 an ounce. With gold now much higher than last year, Gold Fields' cash flow is poised to surge. We can find these same stories at RandGold Resources, B2Gold, Harmony Gold, and IAM Gold, which has the group well positioned to cash in now that gold prices are soaring.

Now what: When the market is in a panic, investors turn to the gold market to find safety. That is great news for gold stocks because they are well positioned to capture higher cash flow from the improved pricing. However, investors need to realize that if market fears abate, Friday's rally could soon fade away.