It's a safe bet that a sizable percentage of investors are in the red for the year. Even those who have managed to beat the market are unlikely to have recorded the kinds of returns they hope for in the long run. But that's OK. At some point, the market will bottom out, and a bull run will start. 

No one can say whether that will happen next year, but even if it doesn't, there are plenty of companies that can deliver excellent returns despite heightened market volatility and a struggling economy. Let's consider two examples: Eli Lilly (LLY 0.69%) and Visa (V 0.95%). Both stocks have outperformed the market this year, and there's good reason to believe both can continue doing it year after year.  

1. Eli Lilly

Pharma giant Eli Lilly has been flying high all year despite its financial results not being particularly impressive. The company's coronavirus-related sales dropped this year after regulators in the U.S. restricted the use of its COVID-19 therapies. Eli Lilly is also facing patent cliffs and pricing challenges within its insulin business, all of which are affecting revenue growth for some essential products. 

In the third quarter, Eli Lilly's revenue increased by just 2% year over year to $6.9 billion. However, the market is forward-looking, and the reason Eli Lilly keeps outperforming is that the company's future looks exciting. Its pipeline -- a key ingredient in the success of any pharmaceutical company -- is more than capable of delivering brand-new blockbuster products. Management recently told investors to expect four new product launches by the end of 2023.

In addition, the company has earned key approvals recently, including that of Mounjaro -- a diabetes medicine -- earlier this year. Mounjaro seems almost destined to become Eli Lilly's next best-selling therapy. In 2020, the drugmaker earned the green light for cancer medicine Retevmo. Many of Eli Lilly's established medicines are still going strong, including cancer drug Verzenio, diabetes therapy Trulicity, and immunosuppressant Taltz. 

Eli Lilly's revenue growth should improve as its newer medicines, Mounjaro and Retevmo, gain more traction, the company earns more brand-new approvals, and the impact of patent cliffs on its financial results fades.

Here's one more reason to buy Eli Lilly's shares heading into the new year: the company's dividend. Eli Lilly's yield of 1.07% may not seem that impressive, but the drugmaker has raised its payouts by 74.2% in the past five years. Eli Lilly's dividend makes it even more attractive to long-term investors. 

2. Visa

Visa is one of those companies whose services millions of people use daily. The payment technology leader helps facilitate credit card transactions and pockets fees every time it does. One of the keys to the company's business is that it does not actually issue credit cards. Instead, it merely uses its payment infrastructure to process transactions, allowing it to avoid credit risk. Visa shares what is essentially a duopoly with Mastercard.

It won't be easy to topple these companies due to their solid competitive edge. The more customers are plugged into Visa's network, the more it is attractive to merchants, and vice-versa. That confers the company a network effect, which makes it harder for newcomers to put up a serious fight against Visa.

Every company faces headwinds, and Visa is no different. It could suffer amid an economic slowdown as customers reduce spending, leading to lower revenue for the company. Also, a decrease in travel activity during the pandemic impacted the company's cross-border volume (the number of cross-border transactions it processes), a vital ingredient of the company's international revenue.

But these headwinds can only momentarily slow down Visa. Consider how the company performed during its fiscal 2022 year, which ended on Sept. 30. The company's net revenue jumped by 22% to $29.3 billion on the back of 15% and 38% year-over-year increases in payment volume and cross-border volume, respectively. On the bottom line, the company recorded adjusted earnings per share of $7.50, representing a 27% jump compared to the year-ago period.

Despite its already robust position in its industry, Visa still has room to grow. As the company's CFO, Vasant Prabhu, said on the company's fiscal fourth-quarter earnings call: "Regardless of near-term uncertainties, we remain as certain as we've ever been about our extraordinary long-term growth opportunity. There is still plenty of cash to digitize in core consumer payments."

Digital payment methods seem ubiquitous, but cash and check transactions are far from dead, especially in the developing world. That grants Visa plenty of whitespace to work with for decades to come. The company remains a solid buy for the coming year and beyond.