As the end of 2022 rapidly approaches, it's increasingly unlikely that the technology-heavy Nasdaq-100 index will pull itself out of bear market territory. It's nursing a 32% decline for the year, which would mark its worst annual performance since the global financial crisis in 2008.

There have been some early signs that the driving forces of the decline, like high inflation, are beginning to resolve. But it could be several months before they feed into the broader stock market, so what should investors do in the meantime?

Buying stocks that outperformed this year could be one path to market-beating returns, in both the short term and the long term. Here are two such stocks, and both are in the rapidly expanding semiconductor industry.

1. Axcelis Technologies is trading in the green this year

Axcelis Technologies (ACLS 1.48%), a tiny semiconductor-service company valued at just $2.6 billion, is trading up 7.3% so far in 2022 despite the rivers of red ink flowing from the broader market. The company doesn't actually produce any advanced computer chips itself. Rather, it supplies ion implantation equipment, which is critical to the fabrication process. 

Its products and services are in incredibly high demand by the world's largest chip makers. The company's order backlog topped a record $1.1 billion in the third quarter (ended Sept. 30), up from $869 million in the prior quarter. Even in the face of a weak economy and a general slowdown in the semiconductor sector, Axcelis is benefiting from the longer-term expansion initiatives across the industry.

The company reports rising demand from a variety of chip makers specializing in different types of hardware, from memory and logic semiconductors to power devices used in automotive and mobile applications.

Axcelis generated $653.9 million in revenue during the first nine months of 2022, which was a 43% increase compared to the same period last year. But the kicker was its earnings. The company's gross profit margin continues to climb, which allows more cash to flow through to the bottom line. Axcelis delivered $3.75 in earnings per share so far this year, a whopping 105% more than it did in the first nine months of 2021.

The company's stellar results prompted it to revise its full-year revenue forecast upward. The guidance now stands at $885 million after opening 2022 at $850 million.

With such a substantial order backlog, there's every reason to believe Axcelis will continue to outperform, which makes it a great bet to continue beating the Nasdaq bear market. 

2. Cohu stock is red, but not as red as the Nasdaq-100

Sometimes outperforming the broader stock market isn't about making gains, but rather making a smaller loss. Cohu (COHU 1.37%) stock has dropped 14.8% this year, which is about half the decline of the Nasdaq-100. The second half of 2022 has been incredibly strong for the semiconductor-service specialist, with its stock jumping by 26% over the last six months.

Like Axcelis Technologies, Cohu doesn't manufacture any chips itself. It sells a broad portfolio of testing and handling equipment designed to streamline the production process. It also provides a suite of services to help train employees and improve customers' return on investment from its platforms.

The company uses advanced technology like artificial intelligence to closely inspect chip hardware for defects that might be invisible to the naked eye. Speed is the name of the game in a demanding production environment, but Cohu's specialty is ensuring quality isn't sacrificed as a result, so the end-user receives a fully functional product. 

Cohu hasn't generated blockbuster growth like Axcelis has this year -- in fact, Cohu's third-quarter revenue fell by 8% year over year to $206 million. But investors are backing the company because of its rapidly expanding gross profit margin, which jumped 5% to 47.5% in the quarter. Cohu is managing its costs, but it's also focusing on building recurring revenue streams because they carry a much higher margin, coming in at 54% most recently. 

Focusing on the long game is key with this company. It's aiming to generate $1 billion in revenue and $4 in earnings per share annually, on average, over the next three to five years.

If Cohu hits its average earnings forecast, in particular, that would place its stock at a price-to-earnings ratio of just 8.4 based on its current share price of $33.64. For context, the Nasdaq-100 index trades at a multiple of 23.5 right now, implying there would be a substantial upside for Cohu stock if the company can deliver.