Oil's incredible decline over the last six months has wreaked havoc on the stocks of all oil companies, including refiners Calumet Specialty Products Partners (NASDAQ:CLMT) and Phillips 66 (NYSE:PSX)

WTI Crude Oil Spot Price Chart
WTI Crude Oil Spot Price data by YCharts

However, what many investors don't realize is that refiners, unlike oil producers, can actually benefit from margin expansion when oil prices fall.

PSX Gross Profit Margin (TTM) Chart
PSX Gross Profit Margin (TTM) data by YCharts

Find out why these two oil refiners may be excellent ways to generate income from oil while avoiding the worst effects from crashing commodity prices. 

How refiners can boost margins when oil falls
There are two ways that refiners can profit from lower oil prices. The first is that decreased prices can boost demand for refined products more than the price of those products drop. In addition cheaper oil means potentially higher refining margins as feedstock costs--crude oil--decrease faster than the prices of the prices of refined products, such as gasoline. This can help boost refining margins as has occurred in the most recent quarter for both Calumet and Phillips 66. 

WTI Crude Oil Spot Price Chart
WTI Crude Oil Spot Price data by YCharts

In fact, both improved margins helped Calumet and Phillips 66 report a 181% and 34% increase, respectively, in Adjusted EBITDA -- earnings before interest, taxes, depreciation, and amortization -- in their most recent quarters. 

How Calumet and Phillips 66 are diversifying to secure future growth
But the main reason I recommend income investors consider these two oil refiners isn't just because of a short-medium term boost to their margins from lower oil prices, but because both Calumet and Phillips 66 are diversifying into higher margin products and services such as specialty products and midstream pipeline operations. 

For example Calumet is famous for its highly disciplined acquisitions of specialty refined petroleum product makers that has grown its specialty portfolio to 6,700 products that it sells to 6,600 global customers. 

In addition to its acquisitions Calumet is also investing in new projects to expand its specialty refining capacity. For example, its Missouri Esters expansion and San Antonio Refinery Solvents Projects are expected to come online in the first and second quarters of 2015, respectively. These projects are expected to increase annual EBITDA by 9.1% this year. 

Meanwhile, Phillips 66 is branching out into natural gas liquids, or NGLs, and midstream pipelines through its MLP, Phillips 66 Partners (NYSE:PSXP). The EBITDA generated by its midstream segment alone is expected to grow 360% between 2013 and 2018.

In addition, Phillips 66 owns 50% of the general partner and incentive distribution rights to DCM Midstream Partners, which is a midstream MLP that gives Phillips access to the fast growing NGL market. NGLs, especially ethane, are at the heart of the $176 billion petrochemical boom occurring on America's Gulf coast. 

Finally, Phillips is partnering with Chevron (NYSE:CVX) on specialty chemical projects. In fact the two companies have 11 joint ventures and fund two research facilities to produce specialty chemicals for sale in 139 countries around the globe. Phillips 66 plans to invest $6.5 to $7 billion into this segment of its business between 2013 and 2017 in hopes of increase the output of higher margin specialty chemicals by 36%.

Bottom line: not all oil stocks are created equal creating long-term investing opportunities
Crude's recent crash has caused the market to punish all oil companies as if they all faced a bleaker future in a world of cheaper oil. However, for Calumet Specialty Products Partners and Phillips 66 this isn't necessarily the case. Higher demand for their products, cheaper input costs, potentially expanding margins, and diversification into specialty refining products and midstream assets are all ways that these two refiners could prosper even if cheap oil prices become a reality over the next several years.