Shares of Micron Technology (MU 2.11%) gained ground on Thursday, climbing as much as 1.1%. While this might not seem like much to celebrate, the gains came against the backdrop of a broader market downturn as the Nasdaq Composite lost 0.8% and the S&P 500 shed 0.6% (as of this writing). As of 1:41 p.m. ET, the stock was still up 0.5%.

The catalyst that sent the memory and storage chipmaker higher was word that the company would receive as much as $13 billion in loans and subsidies from the CHIPS Act.

An influx of cash

The White House announced on Thursday that Micron would receive grants and loans under the CHIPS and Science Act, a program designed to revitalize the semiconductor industry in the U.S. Micron, a leading supplier of memory (DRAM) and storage (NAND) chips, will receive up to $6.1 billion in federal grants to subsidize the construction of two fabrication facilities -- one in Clay, New York, and the other in Boise, Idaho, where Micron is headquartered. In addition to the direct funding, the preliminary agreement also provides $7.5 billion in loans to support these projects.

In return for these funds, Micron has agreed to invest up to $125 billion between the two states over the next two decades to "build a leading-edge memory manufacturing ecosystem."

In addition to the funds from the CHIPS Act, Micron will benefit from the investment tax credit, which provides a credit of 25% for "qualified capital investments." The state of New York is also offering $5.5 billion in incentives over the life of the project.

Micron becomes the fourth chipmaker to receive funds under the program, which has also disbursed $8.5 billion in funds to Intel, $6.6 billion to Taiwan Semiconductor Manufacturing, and $6.4 billion to Samsung.

This represents a strategic opportunity for Micron, yet the stock is selling for less than 4x next year's sales. While that's a slight premium, compared to the multiple of 3x for the S&P 500, the broader opportunity makes Micron a buy.