This past year has been an excellent one for most stocks. While many high-growth companies saw some of the steam come out of their rally in recent weeks, barring a last-minute sell-off, the S&P 500 is on track to end the year up about 20%. 

Despite that big rally, several stocks look like great buys heading into 2022. We asked some of our contributors for their top stocks to buy before 2021 ends. Here's why Magellan Midstream Partners (MMP), Brookfield Renewable (BEPC 1.56%) (BEP 1.63%), and Caterpillar (CAT -0.11%) topped their lists. 

A person changing a block numbers from 2021 to 2022.

Image source: Getty Images.

An underappreciated income stream

Reuben Gregg Brewer (Magellan Midstream Partners): Midstream master limited partnership (MLP) Magellan Midstream Partners' business got hit really hard in the early days of the pandemic. That's not shocking given the downturn in demand in the broader energy sector as economies around the world were, effectively, closed in an attempt to slow the spread of the coronavirus. Travel was a big issue with Magellan, given that roughly 70% of its operating margin comes from refined products pipelines (the rest is from oil pipelines). So falling demand for things like gasoline and jet fuel led to a reduction in demand for Magellan's fee-based energy assets.

In fact, at the start of 2021 investors were worried that Magellan might cut its distribution after having increased it annually since its 2001 initial public offering. Magellan itself warned that distributable cash flow coverage could be tight, perhaps as low as 1.1 times. However, in the end, the midstream company's business picked up more quickly than expected and coverage is now projected to be 1.2 times in 2021 (in line with the MLP's long-term targets) and it raised the distribution in the third quarter, keeping its annual streak alive. 

MMP Financial Debt to EBITDA (TTM) Chart

MMP Financial Debt to EBITDA (TTM) data by YCharts

Essentially, Magellan muddled through a very difficult market in relative stride. That was helped along by its strong balance sheet, with financial debt to equity almost always at the low end of its peer group. And yet the MLP's yield, at around 9.1%, is still one of the highest in the group and at the top end of its historical range. If you are looking for a high yield, you should take a close look at Magellan while it's still deeply out of favor.

Trading at its best value of the year

Matt DiLallo (Brookfield Renewable): Shares of Brookfield Renewable have cooled off considerably in 2021. The renewable energy juggernaut has steadily declined all year and is currently more than 40% below its January peak. That's quite the reversal from 2020 when Brookfield Renewable more than doubled.

While 2020's rally seemed a bit excessive, this year's sell-off looks like an overcorrection. Brookfield Renewable is having an excellent year. The company generated record funds from operations (FFO) in the recently reported third quarter -- up 32% year over year -- as its growth strategy continues to pay dividends. Overall, FFO per share is up nearly 20% through the first nine months of 2021.

Brookfield also made excellent progress on its long-term growth strategy. The company advanced the construction of several development projects, significantly expanded its development pipeline, and invested $600 million across several transactions. It has also emerged as a partner of choice for companies seeking to reduce their carbon emissions. These factors have helped set the stage for future growth. Because of that, Brookfield anticipates growing its FFO per share by as much as 20% per year through 2026.

With shares tumbling 40% this year, Brookfield trades at about 21 times its FFO. That's a very reasonable price to pay for a company that appears poised to grow at a double-digit rate for years to come. Add in its attractive dividend, which currently yields 3.4% after this year's sell-off, and Brookfield Renewable stands out as a great stock to buy before the end of the year.

A top Dividend Aristocrat to play economic growth

Neha Chamaria (Caterpillar): The omicron coronavirus variant has renewed fears of another phase of lockdown that could dent global economic growth and has made investors in leading manufacturing companies like Caterpillar cautious in recent weeks. Yet, Caterpillar is on strong footing, and a long-term investor should find the stock attractive at the current price.

Caterpillar delivered a solid third quarter, growing its revenue by 25% and adjusted earnings per share by 75% year over year. Importantly, Caterpillar's sales volumes surged on higher end-user demand for heavy machinery across all three segments: construction industries, resource industries, and energy and transportation.

In fact, Caterpillar cited strong demand as one reason why its dealer inventories hit multi-year lows in Q3. Caterpillar banks on its vast global dealership network for sales, with declining dealer inventory hinting at higher potential demand for Caterpillar's equipment in the coming months as dealers restock.

Caterpillar chose not to provide any guidance given the supply chain and other macroeconomic uncertainties, but management projected stronger revenue in the fourth quarter versus Q3 and expects to end the year with robust cash flows. That also means investors can easily expect Caterpillar to increase its dividend for the 28th straight year in 2022 and continue to repurchase shares. With the Biden administration also expected to kick off spending under its recently signed infrastructure law, Caterpillar's growth catalysts for 2022 look meatier than any headwinds for now.