With all of the talk surrounding the withering military budget cuts involved with the fiscal cliff and sequestration, it's easy to forget just how good of an investment the defense sector was in 2012. Numerous stocks from the industry notched stellar gains for the year, and big Pentagon projects from fighter jets to missiles got the green light. Yet, one defense stock couldn't be stopped from beating all competition among its rivals and posting a 21% gain this year -- but for 2012's top defense pick, Raytheon (RTN), the year's success may not last into 2013.

Financial fortitude amid uncertainty
Just looking at the numbers, it's hard to grasp just how well Raytheon's performed this year. Revenues have beaten a steady retreat in declining on an annual basis for every quarter this year. For the first nine months of the year, revenues are down a little over 3%. This isn't restricted to Raytheon in any way, however -- fellow defense contractors such as United Technologies (RTX) and Northrop-Grumman (NOC 1.82%) have also seen sales decline by multiple percentage points.

Earnings have performed better, rising for the year so far, but even those declined year-over-year in the third quarter. It's on earnings per share and margins that Raytheon has triumphed through 2012: Raytheon smashed EPS projections in the third quarter by more than 17%. For the full year, earnings per share are up more than 15% year-over-year through nine months. Raytheon's reduction of outstanding shares over the past two years has certainly paid off for investors.

The company has done well on keeping margins high in 2012 despite the Pentagon's tightening budget. Raytheon has been one of the best defense companies at growing its margins, boosting its operating margin by nearly 2% year-over-year in the second quarter and ranking among the best in that category among the top defense players. Its operating margin over the trailing 12 months of 12.8% beats the likes of industry heavyweights such as Lockheed-Martin (LMT -0.55%) and Boeing (BA 0.39%), coming in at more than 50% higher than the latter's.

Yet the decline in revenue over the course of 2012 is a serious concern for investors with the withering budget cuts of the fiscal cliff seeming like an almost certainty these days.

Focusing on what works
The Pentagon's budget of the future may end up significantly smaller than what we see today, but Raytheon's made the right moves in 2012 to continue to rank among the Defense Department's top contractors.

While competitors such as Lockheed and General Dynamics struggle with big-budget military hardware, Raytheon has done a superb job this year of shifting toward the military needs of tomorrow. Despite its sinking sales, Raytheon has managed to boost 2012 revenue in its largest divisions of missile systems, integrated defense systems, and space and airborne systems. It has additionally managed to grow operating margins in all of these divisions, which make up more than 50% of the company's total revenue through the first nine months of 2012.

That's exceptionally important given the shifting priorities of the DoD. With high-cost projects like Lockheed's F-35 fighter criticized for its price tag and usefulness, utilitarian missiles and electronic systems are the road to the future of warfare. Raytheon has done an exceptional job realizing that this year, picking up hefty munitions contracts and acquiring data protection businesses in 2012 to fortify its post-sequestration future. The company has built plants to develop and manufacture missiles this year even while the defense sector at large cuts jobs, a testament to Raytheon's vision of the future of warfare.

It's this expansion of high-need divisions and diversification that has made Raytheon's 2012 a memorable year. This company won't sit on its hands while sequestration looms large, instead continuing to operate its core business while going as far as striking deals to supply civilian technologies and foreign orders to reduce its dependence on the DoD.

Diversifying for the future
While Raytheon may not be the perfect stock with the fiscal cliff and sequestration looking all but assured to arrive, this defense contractor has played its cards well in 2012. Its stock's gains are only the tip of this company's planning for a stricter future for the industry. While 2013 may hurt for all defense contractors, Raytheon's commitment to diversifying its business and growing its margins even while revenue sags shows it can compete in the future. Investors should love how Raytheon performed in 2012, but the future could hold even more gains for this defense powerhouse.