The U.S. dollar has been on a tear in recent months, storming higher against a number of other currencies throughout the globe. But the strength in the dollar is a double-edged sword: Although it benefits consumers in some ways, it can hurt large, multinational corporations and negatively affect their stock prices.

Expectations that the Federal Reserve will hike short-term interest rates this year have driven the U.S. dollar higher in recent months. The Fed’s expected rate hike reflects confidence that the U.S. economy is strong enough to withstand a move toward higher rates. Drilling down to the consumer level, the stronger dollar is good news for U.S. tourists and can make it less expensive to travel abroad.

On the flip side, a stronger U.S. dollar can mean weaker profits for some big, multinational U.S. corporations. A number of companies, from Oracle to Accenture, have acknowledged that the strength in the dollar could negatively affect their bottom line.

The rising dollar can cut into profits at U.S. corporations that sell goods and services abroad in a couple of ways. First, U.S. companies operating abroad are paid in a foreign currency, so when these companies bring home foreign revenues, the conversion back to U.S. dollars means profits are worth less. The second issue is a longer-term concern: A stronger dollar means those goods and services are more expensive for foreign buyers, which could eventually curb demand for U.S. products.

Large corporations can hedge foreign exchange risk in a variety of ways, such as using currency futures contracts, but the speed of the dollar’s gains has taken a number of companies by surprise. The U.S. Dollar index surged 25 percent from July 2014 to its peak in March. That index is a weighted measure of the dollar versus a basket of foreign currencies.

“Some of the companies were asleep at the wheel because [the dollar] moved farther and faster than they expected, and they probably did lose some ground. It negatively affects their earnings,” says Scott Wren, senior global equity strategist at Wells Fargo Investment Institute.

It’s all about the earnings. Why does this matter to stock investors? A key factor driving a company’s stock price is its earnings. “A company’s ability to grow earnings is what helps a stock price move up,” says Pat O’Hare, chief market analyst at Briefing.com, a Chicago-based independent live market analysis company. “We have started to hear a large number of companies bemoaning the stronger dollar.”

The impact of the strong dollar is felt most by large-cap stocks that do a lot of business overseas. “In general, 40 percent of earnings from S&P 500 companies come from international sources, and hence a strong dollar will be a headwind for those multinational companies with significant business overseas,” says Omar Aguilar, senior vice president and chief investment officer of equities at Charles Schwab Investment Management.

Certain stock sectors can have even more exposure. “Megacap multinational companies are the most vulnerable to the strong dollar. Technology, energy and materials have over 50 percent of sales coming from overseas, and the expectation is that they will see an impact on their first-quarter earnings reports,” Aguilar says.

Diversify into domestic sectors. Stock investors looking to reduce the potential influence of the stronger dollar on their portfolios should consider these strategies.

“Investors should diversify by looking at sectors that have more domestic sales and continue to increase their capital expenditures, which include consumer cyclical, health care and financial sectors,” Aguilar says.

Investors who want to eliminate exchange-risk volatility may consider companies that derive their profits from domestic sales. “Look at U.S.-centric companies, like a Southwest Airlines or Dollar General,” O’Hare says.

Shift into mid-cap or small-cap stocks. Small- and mid-cap stocks have been outperforming large-cap stocks since the start of 2015. Small-cap companies typically have sales totaling less than $ 500 million per year, while the annual sales of mid-caps range from $ 500 million to $ 1 billion, Blank says. While the broader Standard & Poor’s 500 index, which includes large, multinational companies, gained 1.1 percent so far this year through early April, the S&P 500 MidCap 400 index rose 5.8 percent, and the SmallCap 600 index gained 4 percent.

“I would attribute every bit of that outperformance to the stronger dollar,” Wren says.

Along with mutual funds, exchange-traded funds are an alternative for investors who want to avoid the challenge of picking individual stocks. “If you’ve got something like the dollar, which is a huge elephant in the room and you just want to stay away from it, you can buy a small-cap ETF and ride the U.S. growth story and stay away from the elephant,” says John Blank, chief equity strategist at Chicago-based Zacks Investment Research. “U.S. small caps are where you want to go, because the U.S. economy is strong, and they aren’t as likely to have business abroad,” Blank says.

One example of a small-cap ETF is iShares U.S. Small Cap Index ETF.

“Dollar bulls” are taking a break. Since hitting a new 11-year high in March, the U.S. Dollar index has taken a pause from its massive rise. Some analysts note the U.S. dollar could be vulnerable to a modest pullback in the short term, since expectations for the timing of the first interest rate hike from the Federal Reserve have been pushed to later in the year amid signs of slightly weaker-than-expected labor market growth. But overall, the dollar trend is expected to continue, as the Fed is one of the few major central banks expected to increase interest rates this year.