ASML (ASML -0.88%) and Lam Research (LRCX 0.47%) are two of the world's top semiconductor equipment makers. ASML is the world's largest producer of lithography systems, which are used to optically etch circuit patterns onto silicon wafers. It's also the only producer of high-end extreme ultraviolet (EUV) lithography systems for producing the world's smallest chips. Lam Research is a top producer of wafer fabrication equipment (WFE) for manufacturing silicon wafers.

Both companies are linchpins and bellwethers of the semiconductor market. But over the past 12 months, Lam's stock nearly doubled as ASML's rose less than 50%. Let's see why Lam generated bigger gains -- and if it's still the better buy this year.

Circuit patterns being optically etched into a silicon wafer.

Image source: Getty Images.

Lam faces a tough slowdown in 2024

In fiscal 2022 (ended in June 2022), Lam's revenue and earnings per share (EPS) grew 18% and 22%, respectively. But in fiscal 2023, its revenue and EPS only increased 1%.

Lam's growth stalled as sales of PCs cooled in a post-pandemic market, consumers bought fewer 5G phones, and U.S. regulators blocked exports of advanced chips to China. Rising interest rates and macro headwinds exacerbated that pain.

For fiscal 2024, analysts expect Lam's revenue and earnings to decline 15%. During its latest conference call this January, CEO Tim Archer said the "business environment remains muted" but a "modest recovery" in the memory market could drive it to a "stronger exit" for the full year. Archer expects the foundry market to remain strong, and for its sales in China to stabilize as the country's chipmakers continue to buy its non-restricted equipment.

Archer also reiterated his bullish long-term outlook for the semiconductor sector, and predicted that WFE spending would "roughly double" by the end of the decade. For fiscal 2025, analysts expect its revenue and earnings to grow 18% and 24%, respectively, as the macro headwinds wane. Lam's stock still looks reasonably valued at 27 times forward earnings, but its forward dividend yield of 0.8% probably won't limit its downside potential nor impress any income investors.

ASML faces many of the same challenges

ASML's revenue rose 14% in 2022 and 30% in 2023. Its growth accelerated as the "process race" between Taiwan Semiconductor Manufacturing Company, Samsung, and Intel to manufacture smaller chips lifted its sales of EUV systems. Chinese chipmakers also scrambled to accumulate more systems before new export curbs kicked in. ASML's EPS dipped 2% in 2022 but surged 41% in 2023.

But for 2024, analysts expect ASML's revenue to rise 2% as its earnings dip 3%. Most of that slowdown could be caused by the export curbs against China and the macro headwinds reducing the market's appetite for its $200 million EUV systems.

However, ASML expects its growth to accelerate significantly next year as the macro environment warms, the company continues to sell unrestricted lithography systems in China, and rolls out its latest high-NA EUV systems for manufacturing chips beyond the 2-nanometer node. For 2025, analysts expect ASML's revenue and earnings to grow 27% and 48%, respectively.

Looking even further ahead, ASML plans to generate 44 billion euros ($48 billion) to 60 billion euros ($65 billion) in annual revenue by 2030. That would represent a compound annual growth rate (CAGR) of 7% to 12% from 2023. That's a healthy long-term outlook, but the stock isn't cheap at 44 times forward earnings and it pays a paltry forward yield of 0.7%.

The better buy: Lam Research

Lam and ASML are both great long-term plays on the semiconductor sector. But if I had to pick one over the other right now, I'd pick Lam because its business is more broadly diversified, the company has passed its cyclical trough, and its stock is cheaper. ASML needs to slog through a sluggish year and its stock still seems a bit too pricey relative to its near-term growth.