AT&T (T 1.61%) and Amazon (AMZN 0.75%) are both often considered stable long-term investments. AT&T is one of the largest telecom companies in the United States, and it has paid continuous dividends for nearly four decades. Amazon is the world's largest e-commerce and cloud infrastructure platform company.

But AT&T's stock slumped 15% over the past 12 months while Amazon's shares rallied more than 20%. While AT&T's investors fretted over its weaker-than-expected free cash flow (FCF) growth, Amazon's investors finally started to look beyond the near-term macroeconomic headwinds.

Will Amazon stay ahead of AT&T throughout the rest of the year?

A family saves pennies in a piggy bank.

Image source: Getty Images.

What happened to AT&T?

Over the past two years, AT&T ditched its dreams of becoming a media superpower. It spun off DirecTV and WarnerMedia, divested its other non-core assets, and focused on expanding its wireless and wireline businesses instead.

But as a slimmed-down telecom company, AT&T is growing again. It added 2.9 million postpaid phone subscribers in 2022 as its larger competitor Verizon (VZ 1.03%) only gained 201,000 comparable subscribers. As for its wireline division, the expansion of its fiber networks partly offset its sluggish growth in business wireline revenues.

That's why AT&T's revenue rose 2% (on a stand-alone basis from continuing operations) to $118.2 billion in 2022. It generated $14.1 billion in FCF for the full year, but its adjusted EPS dipped 2% as it racked up higher 5G and business wireline costs.

Ma Bell added another 424,000 postpaid phone subscribers in the first quarter of 2023, which marked its 12th consecutive quarter of gaining more than 400,000 postpaid phone subscribers, and it maintained a low churn rate of 0.81%. But it only generated $1 billion in FCF during the first quarter, which suggests it could fall short of its goal of growing its FCF by 13% to $16 billion for the full year.

AT&T attributed that slower-than-expected FCF growth to seasonal headwinds as well as its "historically high levels" of 5G and fiber investments, and it insists that most of those costs had peaked in the first quarter. It also claims it can still generate at least $16 billion in FCF for the full year -- so its dividends (which consumed $9.9 billion of its FCF in 2022) should still be safe. For the full year, analysts expect AT&T's revenue to rise 1% but for its higher costs to reduce its adjusted EPS by 6%.

This stock trades at just 6.5 times forward earnings and pays a hefty forward dividend yield of 7%. That low valuation and high yield could limit its downside potential in this volatile market.

What happened to Amazon?

Amazon generates most of its revenue from its e-commerce business, while most of its profits come from its cloud business. The company usually subsidizes the expansion of its lower-margin e-commerce business with its higher-margin cloud revenues.

Both segments grew rapidly during the pandemic as more people shopped online and companies ramped up their usage of its cloud-based services. But that growth spurt ended with the pandemic, and both segments faced tough macro headwinds in 2022: inflation curbed consumer spending, while rising interest rates forced companies to rein in their spending on its cloud-based services. Amazon's investment in the EV maker Rivian (RIVN 3.76%) also backfired and crushed its net profits in recent quarters.

As a result, Amazon's revenue only rose 9% in 2022 as it posted a net loss. For 2023, analysts expect its revenue to rise another 9% as it turns profitable again.

However, that bottom line growth will likely be driven by aggressive cost-cutting measures (including approximately 27,000 layoffs since the end of 2022) instead of Rivian's stabilization or the sustained recovery of its higher-margin cloud and advertising divisions.

That wobbliness is troubling, since Amazon needs to keep pouring cash into its loss-leading strategies -- including fresh content for its streaming media platforms, cheap hardware devices, and big promotions -- to keep expanding its base of over 200 million Prime members. If Amazon starts burning the furniture to boost its profits, it could ultimately throttle the growth of its Prime ecosystem and erode its defenses against formidable competitors like Walmart and Target.

Amazon's near-term growth rates look dismal, but it will likely remain the world's top e-commerce and cloud company for the foreseeable future. Therefore, its prospects should brighten as the macro environment improves. Its stock still isn't cheap at 72 times forward earnings, but that multiple could come down as it starts to generate stable earnings growth again.

The better buy: AT&T

While I personally own shares in both these companies, if I were to buy more shares at the present time, I'd select AT&T over Amazon for three simple reasons: it's cheaper, it pays a high dividend, and it is less exposed to the prevailing macro headwinds. Amazon is still a great long-term investment, but it still faces a lot of near-term challenges and its rally over the past year seems a bit premature.