The U.S. national average for a regular gallon of gas is $4.99 as of this writing, according to the American Automobile Association. A month ago, the average was just $4.37 per gallon. And a year ago, the average was $3.07 per gallon. In other words, the price of gas is up 14% month over month and 63% year over year.

The rapid increase in the price of gas hurts many consumers and many businesses. However, WEX (WEX -0.30%) is an under-the-radar stock that could actually benefit from rising gasoline prices and is therefore worth considering right now.

How the rising price of gas hurts the economy

Data from Yardeni Research shows that consumer spending on gas has reached an all-time high. Spending is reportedly at a $5,000 annual rate, compared to just $2,800 at this time last year. Therefore, gas prices are up 63%, and spending is up 79%. And average incomes haven't kept up in the past year.

High gas prices don't just hurt everyday people -- some businesses can also feel the pain. For example, Target gave its shareholders an update about factors hurting its business on June 7. Management mentioned that rising fuel prices play a big part in the erosion of its profit margins.

To correct this, Target management mentioned that it's taking "pricing actions." In other words, the company will pass this expense on to consumers. Therefore, consumers are getting hit twice. First, they're spending more to drive to the store. And second, prices are going up to compensate for fuel prices. The end result is consumers have less discretionary money to spend as they prioritize the must-haves. Eventually, this trickles down to companies whose products are more like nice-to-haves than everyday essentials.

It's not all doom and gloom for your investments. For example, Target isn't the only retail company dealing with this challenge -- they all are. Target can raise prices to offset the rising cost of gas because other retailers will do the same. Therefore, consumers can't push back against Target because prices will go up everywhere. In short, Target's profit margins should come back

The same goes for consumers. Eventually, it's reasonable to assume that incomes will go up to match the impact of inflation. There may be a multi-year lag. But it's unreasonable to think that consumer-discretionary spending is dead forever. 

That said, companies that are in poor financial health or in a poor competitive position may be permanently impacted by what's going on in the economy right now. And the strong companies could see their earnings per share negatively impacted for now.

This is why I want to highlight WEX stock.

How WEX benefits (in theory)

WEX has three business segments, with the largest segment (62% of revenue in the first quarter of 2022) being its Fleet Solutions. Within this segment are its corporate fleet fuel cards. Businesses trust WEX to process fuel payments. And they choose WEX because it captures more fleet-specific data than regular payment processors, and it helps cut down on fraud. 

In its 2021 annual report, WEX estimated that every time gas prices fluctuate one penny, it impacts revenue by $1.5 million. Consider that the national average for gas was about $3.28 per gallon to start 2022, according to the Department of Energy. At $4.99 per gallon right now, gas is up 171 pennies this year. Therefore, this could positively impact WEX's revenue by over $250 million -- not bad for a company with just a $7.7 billion market capitalization and less than $2 billion in annual revenues.

Wall Street analysts have recently upgraded their outlooks for WEX stock and rival FleetCor Technologies because of this dynamic. But these companies only benefit as much as I'm describing in theory. In reality, higher gas prices could cause certain corporate fleets to cut back on driving when possible and offset the benefit of higher fuel costs.

However, WEX doesn't only offer fuel cards -- the company also has corporate travel services and healthcare-management solutions. All three of these business segments showed year-over-year growth in Q1. And the strength across its business in Q1 motivated management to raise next year's full-year revenue guidance from the $2.05 billion to $2.09 billion range to the $2.155 billion to $2.195 billion range.

Therefore, at the midpoint of full-year revenue guidance, WEX stock trades at just 3.5 times this year's sales. This is a pretty fair valuation for a profitable company ($128 million in Q1 net income) with the strong tailwind of fuel prices right now.

Moreover, WEX management recently laid out a five-year plan to grow revenue at a 10% to 15% compound annual rate going forward. This growth could be enough to turn this into a market-beating investment. Therefore, WEXs good times could continue beyond 2022 and high fuel prices.