Micron Technology (MU -0.18%) faces tough headwinds right now thanks to the downturn in the memory industry, but that hasn't stopped the chipmaker from thinking big.

The memory specialist revealed on Oct. 4 that it will be spending $100 billion over the next couple of decades to build a mega fabrication plant in upstate New York. Once complete, this would be the largest semiconductor fab in the U.S., and it would help Micron meet the booming demand for memory chips in the long run. Micron expects to spend $20 billion of this planned investment by the end of this decade.

If you're wondering how you can take advantage of Micron's big splurge, look no further than Lam Research (LRCX 1.87%). The semiconductor equipment supplier could win big from Micron's ambitious investment plan in the long run. Let's see how.

Lam Research specializes in memory manufacturing equipment

Lam Research makes equipment that's used for fabricating integrated circuits, and most of its revenue comes from supplying this equipment to memory manufacturers. Specifically, 54% of Lam's revenue came from the memory business during the quarter that ended in June.

That strong reliance on the memory business was a key reason behind Lam's impressive performance during the quarter. The company's revenue was up 12% year over year to $4.64 billion. Adjusted earnings increased from $8.09 per share in the prior-year period to $8.83 per share.

The oversupply in the memory industry will weigh on Lam's performance in the near term, as manufacturers cut their capital spending budgets to manage the downturn. However, investors shouldn't miss the forest for the trees -- the memory market should boom in the long run, which is precisely the reason why Micron has laid out an ambitious investment plan.

Lam Research counts Micron as one of its "most significant customers," along with other memory industry participants such as Samsung, SK Hynix, and Kioxia. Lam doesn't publicize exactly how much revenue it gets from supplying its equipment to Micron. But the company's relationships with major memory manufacturers indicate that its offerings are crucial to the likes of Micron and others.

So Micron's grand spending plan is going to be a catalyst for Lam Research in the long run. But this is not the only reason to buy the stock. Micron estimates that the DRAM (dynamic random access memory) and the NAND flash memory markets will together generate combined revenue of $330 billion by 2030. That would be more than double last year's revenue of $161 billion.

Meanwhile, third-party estimates from market research firm Imarc Group paint a rosier picture. The firm sees the memory chip market generating $410 billion in revenue by 2027, compared to $154 billion last year. It is not surprising to see that the memory market is expected to take off in the long run. After all, more memory is set to be deployed across a variety of applications, ranging from data centers to smartphones to cars.

The arrival of 5G smartphones, for example, led to a sharp increase in the average memory content per smartphone. And the increasing levels of automation could lead to a 30x increase in DRAM consumption in vehicles, as well as a 100x increase in NAND deployment.

So memory manufacturers such as Micron will have to boost their investments in equipment to meet the growth in end-market demand. This bodes well for Lam Research, as Micron's announcement could spur other memory market participants into action and expand the former's addressable opportunity.

Investors will have to be patient

Investments by the likes of Micron in memory manufacturing capacity will not reap immediate benefits for Lam Research. We have seen that the memory market is currently in a state of oversupply, which is why manufacturers cut their capital spending.

That's why investors will have to be patient with Lam Research, as the end-market opportunity will take time to materialize, and the near-term turbulence in the memory industry could weigh on the company's stock price. However, investors can consider accumulating Lam stock if it falls further.

The stock currently trades at just 10.7 times trailing earnings and 9.3 times forward earnings, so investors may have an opportunity to buy it at a dirt cheap valuation thanks to the memory market's weakness. And Lam can reward patient investors with a nice dividend yield of 1.74%, which seems sustainable given its payout ratio of less than 19%.

All this makes Lam Research an ideal bet for investors looking to take advantage of the growth in memory spending in the long run, but they should also be prepared for near-term volatility in the stock.