What happened

Shares of packaged-foods companies Campbell Soup (CPB -0.64%)Hershey (HSY -2.69%), and J.M. Smucker (SJM -0.53%), along with craft brewing giant Boston Beer (SAM 1.44%), surged on March 17. Boston Beer finished up 13%, while Hershey gained 10.2% on the day. Both Campbell and Smucker closed up about 9% after giving up some of their earlier gains in afternoon trading.

So what

Today's big move was the same thing that lifted most stocks today: news that the federal government was taking more big actions to soften the economic blow from the COVID-19 pandemic. 

Empty supermarket shelves.

Image source: Getty Images.

In a press briefing today, the White House announced a number of steps, including additional actions the Federal Reserve would take to keep the financial system functioning. Over the weekend the Fed lowered a key interbank interest rate to near zero and announced a plan to inject $700 billion into the financial system, primarily buying Treasuries and mortgage-backed securities. Today, the Fed said it would make further investments, with a plan to purchase commercial paper, which is high-quality debt in private companies. 

In addition to actions to support businesses and the overall financial system, a plan to provide direct financial relief to individuals is also making its way through congress. Legislation to send $1,000 to every American adult has bipartisan report and is likely to gain approval in the days ahead. 

Today's market reaction views that as excellent news, as it will provide much-needed cash to the millions of families who are expected to see a combination of layoffs and business closures affect their income in the weeks and months to come. 

Now what

After today's big jump, Smucker and Campbell shares are up 12% and 6% since Feb. 19, when stocks started falling sharply on coronavirus worries. This is a reflection of the nature of their core businesses, selling staple goods that have been in increasing demand in recent weeks. Supermarkets can keep canned food and soup shelves stocked under extreme demand that could continue for months as people isolate themselves and stop eating out. 

For Hershey and Boston Beer, which sell more discretionary goods, today's gains help claw back some of the losses they have suffered, but they're still down 14% and 19% since late February. Simply put, investors don't expect them to hold up nearly as well as Smucker and Campbell, particularly Boston Beer because of the closure of bars and the cancellation of so many public events that drive significant beer consumption. Millions of adult beverages that would normally be served at a concert or sporting event over the next few months will remain in the keg, can, or bottle. 

And while both could see some reduction in demand, I think investors should look at the bigger picture. Despite economic pressures, people will continue to seek pleasurable food and beverage experiences, potentially more than normal during the stressful and worrying times to come. At the very least, it seems reasonable to expect both companies to join Campbell and Smucker as relevant and likely to come out the other side of this just fine. 

And with that in mind, one look at history should remind investors that market crashes have always been the best times to buy stocks. That's not to say that any one -- or even all four -- of these companies won't see their stocks fall again. The economic news is likely to get worse, and when we start getting GDP and unemployment data in the next few weeks, Mr. Market could sell off sharply. 

But looking out a year or three or five, today's prices will probably look very, very good. You just have to be willing and able to hold through the turbulent months to come.