PepsiCo (PEP 0.33%) and Altria (MO -0.49%) are two stocks that have been headed in very different directions over the past few years, but where they go from here will depend on how diversified they are and their ability to handle what could be some very challenging economic conditions. Let's take a closer look to see which company is in better shape today.

PepsiCo's financials are strong even amid some modest growth numbers

In its most recent quarterly report, PepsiCo beat earnings-per-share expectations by a healthy margin of $1.56 versus estimates of $1.50. Its revenue of $17.19 billion, however, came in just 1.5% higher than the $16.93 billion that was expected by analysts. Its organic growth was a modest 4.3% from the prior year, and that's actually above the 4% it plans to finish 2019 with.

Those are good numbers, but they also aren't terribly strong given that the economy is still doing very well. And the company is still dependent on its North American market, perhaps a bit too much. With 60% of the company's sales coming from its home continent this past quarter, it has a lot of exposure there.

Two soda cans in ice.

Image Source: Getty Images.

The good news, however, is that the company is also making progress with its healthier products, which are gaining more market share. But it's unlikely they will be able to give the company much diversification, as PepsiCo's key products are still chips and soft drinks and will likely remain that way for a long time.

Nonetheless, its strategy has been working thus far, with the company generating at least $2 billion in operating income in each of the past four quarters, and there's definitely a buffer there even if the company were to see a slowdown in its growth rate.

Altria is just full of risk

Things were looking good for Altria; the company seemed to be in a strong position to take advantage of the popularity not only of vaping products but of cannabis as well. And then vaping-related illnesses and deaths led to a lot of questions surrounding the safety of vaping. With the U.S. and other countries looking to impose bans on flavored cigarettes, Altria recognized that it had to write down its investment in e-cigarette maker Juul to the tune of $4.5 billion before taxes. That had a devastating impact on its Q3 results. From an operating profit of $2.9 billion, the company finished with a net loss of $2.6 billion.

The investment was looking like a nice complement to Altria's investment in cannabis producer Cronos Group (CRON). Unfortunately, with the cannabis industry having its own problems to worry about and with vaping being a large part of the potential that Cronos was hoping for, it's also put that investment under the microscope. Cronos' stock has been overvalued for some time, even by expensive pot stock standards.

While there are some good opportunities for Altria to benefit from these investments, the problem is that there's probably going to be a stigma surrounding vaping for some time, which could hinder that growth. Even though the Centers for Disease Control and Prevention appears confident that vitamin E acetate is likely to blame for the illnesses, which is possibly due to black-market products, that might not be enough to be able to convince consumers that the products are safe.

PepsiCo is the easy winner

Given all the adversity facing Altria's investments, the stock might not be worth the headaches that will come with owning it. The company has put itself right into the middle of a very polarizing topic -- vaping -- and how it plays out is debatable at this point. Even if the issues surrounding the health concerns are resolved, consumers are likely to have second thoughts about vaping, which could continue to weigh on not only Juul but Cronos as well.

And although PepsiCo might have question marks around its growth too, it's a less volatile stock today. It's no surprise PepsiCo has risen 15% over the past two years while Altria has fallen by more than 29%. It's a safer, more wholesome brand that investors and consumers can get behind, and that's why it's the better buy for the long term.