Folks are feeling the pinch of rising prices. According to the Bureau of Labor Statistics, in December, the Consumer Price Index rose at the fastest rate since June 1982.

It doesn't appear that price increases will abate anytime soon. The coronavirus pandemic is causing supply chain disruptions worldwide, and outbreaks of COVID-19 at a manufacturing facility could shut down production for weeks. And while several effective vaccines have been developed against COVID-19, they are most effective at preventing severe disease and less effective against infection. Therefore, although almost 9 billion doses of vaccines have been administered into people's arms, coronavirus infections remain stubbornly high.

So with supply chains remaining disrupted in the near term, leading in all likelihood to higher prices, here are two stocks you can buy that could benefit from that economic backdrop. 

A masked shopper pushes a full cart through a grocery store.

Image source: Getty Images.

Disney 

Walt Disney (DIS -0.83%) can do well during inflationary periods because it has a combination of differentiated products and services that consumers can't find elsewhere. For instance, productions of Star Wars, Marvel, and other properties are only available through Disney. That gives the company the leverage to increase prices on products and content that feature its characters without losing a meaningful number of customers. 

Moreover, when Disney's theme parks were forced to close, management made changes to provide cost mitigation and increased revenue. Already, Disney highlighted that in its most recent quarter, ended Oct. 2, guests are spending 30% more at its theme parks than in the same quarter of 2019. Disney has increased prices on tickets, parking, food, and more. It has also implemented mobile ordering at theme parks, requiring less staff to take customer orders and process payments.

In its streaming services segment, Disney recently increased prices on Disney+, and the service still has 44 million more subscribers than last year. That's a sign that people aren't canceling their subscriptions over the higher prices.

Overall, Disney has demonstrated pricing power in nearly all its business segments and can continue raising prices if it needs to offset rising input costs. As a result, the company can protect its profits during hard times. 

Costco 

Membership warehouse retailer Costco (COST -0.11%) is another company that can do well during periods of rising consumer prices. Over the decades, the company has built a strong relationship with its customers, offering them low prices and good value. That reputation could allow Costco to increase the prices of products at the store without repelling large groups of customers.

Already, consumers are willing to pay the annual membership fees of either $60 or $120 for the privilege of shopping at Costco. As of its fiscal 2022 first quarter, which ended Nov. 21, Costco boasted 62.5 million paying households, up by 800,000 from the previous quarter. If inflation keeps taking a toll on consumers' bank accounts, more may turn to a Costco membership for the savings it offers.

It's impressive how Costco generates healthy and growing operating profits despite offering fantastic prices to consumers and thin margins for itself. Indeed, Costco has never earned an operating profit margin of over 3.5% over the past decade. Even so, it increased overall operating profits from $2.7 billion in 2012 to $6.7 billion in 2021.

Disney and Costco have pricing power 

Disney and Costco are smart stocks to buy during this inflationary economy because they have pricing power. These companies can increase prices on their products and services, and customers have shown that they will stick with the companies anyhow.