After months of tense and, at times, bitter negotiations, Ukraine has brokered a deal to resume natural gas shipments from Russia and keep the pipelines open through the coming winter.  The settlement includes an negotiated rate on future gas shipments and—with the help of the European Union—the settling of more $3 billion in debts owed by Ukraine.

"There is now no reason for people in Europe to stay cold this winter,'' said European Commission President Jose Manuel Barroso in a statement.

The narrowly-averted crisis dates back to the Euro Maidan protests at the beginning of this year, when Ukrainian President Viktor Yanukovych was pushed out of office. When he left Kiev, a substantial discount on Russian gas that had been previously negotiated between his government and Moscow went with him, nearly doubling the price that Ukraine had to pay for natural gas. Kiev halted payments as they objected to the new price, and in return, Russia cut off new shipments in June.

But it wasn't just Ukraine that was facing higher prices and a lack of heating options this winter. Russia supplies 23 percent of all of the EU's natural gas, and nearly 70 percent of that reaches them via pipelines that run through Ukraine.

That's why the EU and the International Monetary Fund have stepped in to help foot the bill. The EU will contribute funds to help Ukraine settle its outstanding debt before the end of the year, and the IMF has essentially guaranteed Ukraine's ability to borrow money when needed to make future payments.

Until March 2015, Ukraine will pay $385 per 1,000 cubic meters of gas, a $100 discount over what Russia was asking for. However, if a new deal isn't negotiated by April of next year, the price will return to $485 per 1,000 cubic meters.