The Ukraine-Russia relationship is actually a terribly complicated one.
They have been been the same country for centuries and have these complicated love-hate issues and identity crises. Ukraine is trying to create its brand as a pro-western country, but it wants to buy gas on preferential prices
(it's a having vs eating the cake situation). The way they deal with Russia and their common past is actually typically soviet - they do everything in the most annoying and painful (for the Russians) way, and they often get an equally irrational answer.
Ukraine is in a perpetual political crisis and a president vs prime minister war. It is almost bankrupt and unprepared for the world economic crisis (which naturally stimulates gas theft). So the timing of this confilict can be linked to both  the Russians carefully choosing the moment for revenge and to one of the sides in the interior political war having stronger connections in Moscow.
Ukraine wants to join the EU and NATO, and this conflict represents it as someone very unreliable - which is a good thing for Russia; though Russia doesn't earn a lot of credit either. If Ukraine is deemed unreliable, there are chances that several other projects for Russian tubes  avoinding Ukraine (North Stream and South Stream) will get completed faster. But there are also chances that Europe will want to avoid Russian dependence altogether.
So naturally, energy dependence is a huge thing. Most of Russia lives on oil export - so low oil prices are a disaster for them. Now, there is this magic thing called Middle East, which can drive the prices high... It's currently  in the news, and it sounds similar to  gas, btw.