After languishing for almost two years, Western Refinery (NYSE: WNR) is making a strong comeback, thanks largely to astute planning and some intelligent risk-taking.

The company, which operates as an independent crude oil refiner and marketer of refined products, has already posted profits in the second and third quarters of 2010, and it's poised to continue this trend in Q4. Though considerably smaller, Western has even performed reasonably well in comparison to stodgier, larger companies with proven track records in the refinery business, like Valero Energy (NYSE: VLO) and Conoco-Philips (NYSE: COP) . As a very specialized play, I think it stacks up well against these rivals going forward.

Fortunate as well as smart
Thanks to the strategic location of the company's flagship El Paso refinery, Western is well-situated to serve two separate geographic areas, which allows it to diversify its market pricing exposure between the West Coast and the Gulf Coast. This gives the company the advantage of being able to put its eggs in more than one basket at any one time, depending on regional market dynamics. Yet the company's biggest gain may owe to its $1.15 billion acquisition of Giant Industries, which enabled Western to increase its sour and heavy crude oil processing capacity from 12% to 44% by December 2009 (as a percent of its total crude oil capacity).

Because of the larger fall in demand for oil and gas in the U.S. since the Great Recession, refineries' costs of production have risen sharply. As Americans buy more efficient cars, pursue alternate fuels like biodiesel, and otherwise reduce their fuel consumption, refiners have been saddled with excess capacity, dragging down earnings for Western and others like it.

To its credit, Western smartly cut costs by suspending refining operations at Bloomfield and converting it to a products terminal, instead of resorting to a total shutdown. This ensured that Western did not lose out to competitors by simply selling off one of its refineries, and left the company well-positioned once demand picked up again.

Much to look forward to
In my opinion, Western is sitting pretty today. With its expertise in transport -- again, thanks to the acquisition of Giant -- and storage facilities approximating 4.3 million barrels, the company can now bank on various strategic benefits. Also, as demand for diesel continues to grow worldwide, especially in the emerging BRIC markets, supply for the export market is forecast to increase substantially. This will definitely offset the low demand within the U.S.

Overall, I think there's good reason to believe that Western's recent success will continue into the future. I suspect that despite the constraints of our uncertain economic environment, all the drivers I've mentioned will keep propelling the company forward.