Image source: Getty Images.

Oil spent most of the week above $50 a barrel, though it did close just under that key level and was barely up for the week. Still, oil around $50 a barrel is great news for producers because it will fuel much improved cash flows. It's that hope for higher cash flow that fueled another big rally in energy stocks this week.

According to S&P Global Market Intelligence data, among the best-performing energy stocks this week were Emerge Energy Services (NYSE: EMES), Penn West Petroleum (NYSE: PWE), Baytex Energy Corp. (NYSE:BTE), Ocean Rig UDW (NASDAQ:ORIG), and Eclipse Resources Corp. (NYSE: ECR)

Oil being around $50 a barrel is giving producers a lot more options. Baytex Energy, for example, was able to bring the bulk of its shut-in wells back online, because they are now economical at current prices. That's a big deal for Baytex Energy because it had to shut in 9% of its production earlier this year due to very low, and in some cases negative, margins. Meanwhile, improving oil prices are also improving the value Penn West Petroleum can fetch on asset sales. In fact, according to a report this week, Penn West Petroleum received multiple bids for its Viking assets, with those bids reportedly coming in C$100 million above analyst expectations. 

Speaking of analysts, they were the primary drivers fueling the big gains in Emerge Energy Services, Ocean Rig, and Eclipse Resources. That's after all three companies were the recipient of positive analyst comments which not only brought in buyers, but also pushed short-sellers to the exits, with short-covering really evident in the big moves of Emerge Energy Service and Ocean Rig.

To learn more about why these stocks moved so sharply, check out the following slideshow.