What happened

Shares of Walgreens Boots Alliance (WBA 0.71%) are up almost 8% at 2:41 p.m. EDT today, having held on to most of their earlier gains while other retail-focused stocks have shifted from gaining to falling in afternoon trading. 

Today's big jump comes on news that the U.S. Senate has passed a massive $2 trillion economic stimulus, with the bill now heading to the House, where it is expected to gain quick approval before heading to the White House for a signature. The bill includes significant aid for individuals, including direct payments and an extension of unemployment benefits, as well as money to help businesses faced with the financial implications of large swaths of the economy being essentially closed for business during the coronavirus pandemic. 

Woman holding medication bottle in pharmacy.

Image source: Getty Images.

So what

Other retail stocks gave up earlier gains and even fell into negative territory, likely because people are starting to remember that the near-term outlook for many consumer discretionary retailers remains very bleak. Much of the $2 trillion in stimulus is aimed at individuals via extended unemployment benefits and direct cash payments. The rest will be used to provide a lifeline to struggling companies, not pad their bottom lines

Walgreens, on the other hand, is likely to prove to be a crucially important retailer for the duration. Access to medication is an obvious need that will keep its pharmacies open, but the company also sells many of the staples people use every day. Walgreens is also one of the places that's providing COVID-19 testing spaces, so its role to get ahead of this pandemic is increasingly important. 

Now what

Walgreens Boots Alliance shares are still down about 14% since the market started falling in earnest on Feb. 20, and it's likely that its business results should remain, if not strong, then far more material than many other retailers over the next few months. And that should also help prop up its share price. 

But that's not a promise it won't also fall at times, and potentially even further than it did at its lowest point in the past few weeks. Over the next few weeks, more economic data will come out, and as we see the full effects of COVID-19 on the economy, today's buyers could turn into sellers. 

What should investors do? To start, remember that market crashes historically represent excellent times to buy, as long as you're willing and able to hold for years at a time. Chances are, today's prices could represent good value to investors who hold through the downturn and the eventual recovery.

But with that said, it's probably not the best investment in its industry. If you're looking at Walgreens right now, bigger and more diversified competitor CVS Health (NYSE: CVS) is moving more quickly to adapt to changes in the healthcare industry, and looks to have better prospects