Artificial intelligence (AI) could be the next big thing in healthcare. Companies may predict surgical outcomes, select the best drug candidates, improve manufacturing processes -- and these are just a few examples. AI's uses seem unlimited.

No wonder AI's growth in healthcare is set to explode. The market is forecast to expand at a compound annual growth rate of more than 37% this decade, according to Grand View Research. And two companies are particularly interested in tapping into that market: Biotech star Moderna (MRNA 13.67%) and medical device giant Medtronic (MDT 0.69%). Which is the best AI healthcare buy right now? Let's find out.

The case for Moderna

COVID-19 vaccine maker Moderna already is known for its speed. It brought the vaccine from drawing board to commercialization in less than a year.

The company's candidates are based on messenger RNA technology. This means Moderna constructs mRNA in a lab. It is then used to instruct the body to prevent or treat a certain illness. This avoids the lengthy process of growing viruses, which is generally a part of traditional vaccine development.

Now, Moderna hopes AI will help it become even faster and more efficient too. The company recently inked a deal with International Business Machines (IBM) to incorporate AI and quantum computing into its processes.

IBM's generative AI may help Moderna researchers better understand molecules' activity. Moderna will use MoLFormer, an AI tool, to predict a molecule's properties. This should help the company better understand potential candidates and possibly increase the pace of development. Moderna aims to use MoLFormer in the construction of the lipid nanoparticles that encapsulate its mRNA.

Moderna will also put to work IBM's quantum-computing technologies for questions classic computers haven't been able to solve.

And earlier this year, Moderna announced new offices and jobs with a particular focus in the area of AI. In fact, Moderna says it's investing today to build a workforce adapted to the quantum era.

The biotech isn't completely new to the AI world. For example, Moderna has been using AI to help it produce the best mRNA sequences for its researchers' experiments.

The biotech also has what it takes to pursue AI from a financial perspective. Thanks to sales of its coronavirus vaccine, Moderna has built up $18.2 billion in cash.

The case for Medtronic

Medtronic generates billions of dollars in earnings annually from its vast portfolio of medical devices sold worldwide. The company treats conditions in a variety of areas, from cardiovascular to neuroscience. Medtronic generates more than $4 billion in free cash flow. And its goal is to invest in research and development at the level of or above revenue growth.

So, Medtronic has what it takes to invest in AI, and it also has the sort of portfolio that could benefit. Like Moderna, Medtronic isn't new to AI. It's already using the technology to help surgeons better predict the outcomes of spinal surgery, for example. That way, they can plan ahead about how to approach each procedure. This is through Medtronic's next-generation UNiD spine analyzer.

The company recently announced a new deal to strengthen the AI capabilities of its GI Genius intelligent endoscopy tool. Medtronic is partnering with Nvidia to bring that company's Holoscan and IGX technologies to the GI Genius.

As a result, doctors will benefit from AI-enhanced diagnostic images during colonoscopy to help them better identify precancerous polyps. The deal with Nvidia and another partner, Cosmo Pharmaceuticals, also allows third-party developers to try and test AI models that eventually could become part of the GI Genius.

Analysts also see Medtronic as a hot contender for dominance in the AI healthcare market. The company is among the top five so far, according to GlobalData. This ranking is based in part on  hiring statistics and mentions of AI in company filings.

Moderna or Medtronic?

Which is the better buy? It looks like both companies have the financial resources to invest in AI and are taking the steps to commit to this newish technology. In general, I'm optimistic about Moderna and Medtronic over the long term.

They both are quite different, though. So consider that before you invest. Moderna, as a young biotech depending on one product so far, carries more risk. It also may offer more potential for gains on good news.

Medtronic offers you the security of an enormous product portfolio and a dividend.

Investors comfortable with some risk might go for Moderna, while more cautious investors opt for Medtronic.

But let's add in the AI element now. And here, if you truly want to bet on AI in healthcare, I would go for Medtronic. The company has more than gotten its feet wet in this area. And its wide portfolio of products means the sky is the limit in terms of opportunities to incorporate AI. For Medtronic -- and its investors -- the AI story could be big.