I've traditionally found it all too easy to ignore the refining portion of the energy sector. By doing so in 2012, however, Fools missed an opportunity for big gains.

I'm referring primarily to Tesoro (ANDV), which during this topsy-turvy year has seen its share price rocket -- in a relative sense, of course -- to a level fully 80% above its early January levels. That's not to say, however, that the company was an outlier in its group.

Its San Antonio neighbor Valero (VLO 0.86%) has managed to chalk up a year-to-date gain comfortably above 60%. And Phillips 66 (PSX 0.91%), spin-off of the refinery assets of ConocoPhillips (COP 1.23%) during the year, is now trading more than 50% above its level on the April day when it was granted its independence.

But I'm inclined to look first at Tesoro in my tromp through the refiners' world. The company operates seven refineries in the western U.S., including one each in Hawaii and Alaska and others spread among Washington, California, Utah, and North Dakota. The seven provide a combined capacity of 675,000 barrels per day.

In addition, its retail-marketing system includes about 1,375 branded retail stations. Of that number, 590 operate under the Tesoro name, while the rest are Shell (RDS.B) and USA Gasoline brands.

A buying spree
Despite being founded in 1968, Tesoro's current group of refineries began to be assembled in 1998 with the purchase of units in Kapolei, Hawaii, and Anacortes, Washington. It's latest still-in-the-works purchase involves the yet-to-be completed acquisition of BP's (BP 1.58%) Carson, Calif., refinery. In August, Tesoro agreed to pay about $1.2 billion, along with the value of the inventory at the time of closing for the sizable facility. When the acquisition was announced, the inventory was valued at about $1.3 billion. The transaction is expected to close in mid-2013, assuming the receipt of regulatory approvals.

 The BP unit is located in the same general area of Southern California as Valero's Wilmington, Calif., refinery. The company's other California unit is in Martinez, north of Oakland in the San Francisco Bay Area. You may recall that Martinez was the site of a major fire at a Chevron (CVX 1.54%) refinery last summer.

But while the Wilmington unit's capacity currently sits at 97,000 barrels per day, the Carson refinery will boost the company's total capacity by 266,000 daily barrels. That's an addition of about 40%.

From a financial perspective, the facility, once it's acquired, is expected to contribute a not-inconsequential cash flow run rate of $1 billion each year. Further, its addition is expected to be accretive to the company's earnings to the tune of about 24% in each of the first two years.

The other side of the tracks
Last month, Tesoro also completed the sale of the Anacortes Rail Unloading Facility to Tesoro Logistics LP (ANDX). The latter company is a fee-based limited partnership that was previously formed by Tesoro. Its purpose is to own, develop, operate, and acquire assets related to crude oil and refined products logistics. The sale, for which Tesoro received total compensation of about $180 million, is expected to add some $19 million in annual EBITDA to the logistics facility. The assets involved in the sale consist largely of a four-track offloading station with the ability to unload 100 car unit-trains. As its name would indicate, it's located in proximity to Tesoro's Anacortes refinery.

Through the first three quarters of 2012, Tesoro recorded net earnings of $716 million, or $5.06 per share, vs. comparable 2011 figures of $670 million, or $4.65 per share. Revenues increased 9.3% year over year to $24.7 billion. For the current quarter, the consensus expectation is for per-share earnings of $1.60, a decided reversal of the $0.89 loss in the final quarter of 2011.

Comparing the trio
With the above information as a backdrop, the questions become (1) how Tesoro stacks up against its peers, and (2) whether, despite its massive gain in 2012, the company remains attractive for the coming new year. For at least an initial approach to responding to these questions, let's compare a few key metrics for Tesoro, compared with those of the above-mentioned Valero and Phillips 66:

Metrics

TSO

VLO

PSX

Forward P/E

7.53

7.07

8.07

PEG Ratio

0.43

1.05

1.25

Operating Margin

3.60%

2.82%

2.00%

Total Debt/Equity

33.72

40.54

38.72

Forward Annual Yield

1.40%

2.10%

1.90%

Sources: Yahoo! Finance and TMF calculations.

A Foolish takeaway
As you can see, Tesoro sits amid Valero and Phillips 66 vis-a-vis its forward P/E, something that's somewhat difficult to explain, given the clear superiority of its PEG ratio, operating margin, and level of debt to equity. Only regarding forward annual dividend yield -- the one item that's completely under the company's instantaneous control -- is Tesoro the laggard. And given the totality of the metrics, I must admit to some confusion relating to Tesoro's three-star CAPS rating, while the other two refiners each sport five stars.

Indeed, if I'm seeking refining representation for 2013, I'm likely to head first toward Tesoro.