Companies that have managed to beat the market and stay in the green during this challenging year are rare, but they exist. But investors shouldn't rush to buy shares of such companies for that reason alone. Outperforming during a bear market is great. What's more important is to deliver market-beating returns over the long haul. And thankfully, some of those recent outperformers seem capable of doing just that. Let's consider two examples: Novo Nordisk (NVO 2.08%) and Amgen (AMGN 1.11%).

1. Novo Nordisk

Novo Nordisk is a pharmaceutical giant headquartered in Denmark and specializing in diabetes care. It has been a leader in this area for several decades, partly explaining its performance year to date. Diabetes patients won't stop taking the medicines they need to keep this chronic illness in check, nor will physicians stop prescribing those therapies.

Novo Nordisk held a 31.6% share of the diabetes care market as of August, an increase of 1.7% year over year. Novo Nordisk should carry its momentum into next year. Some of its products are still performing well, especially diabetes medicines Rybelsus and Ozempic. In the first nine months of the year, sales of Rybelsus soared by 140% year over year to 7.2 billion Danish kroner (about $1 billion USD).

Ozempic's revenue jumped by 86% year over year to 42.8 billion DKK (about $6.1 billion USD). Novo Nordisk's total sales for the period came in at 128.9 billion DKK ($18.4 billion), 26% higher than the prior-year quarter. The company is also looking at a critical regulatory development that could jolt its stock price next year. Novo Nordisk is working on icodec, a new insulin product that could greatly simplify the lives of diabetes patients since it is a once-weekly option.

Icodec has already delivered solid results in various late-stage clinical trials. Novo Nordisk plans on submitting regulatory applications for it in the first half of next year. This once again highlights Novo Nordisk's ability to innovate within its main therapeutic area. And that will serve it well in the coming years. The prevalence of chronic diseases, including diabetes, is growing while the world's population ages.

These two factors will only increase the need for more breakthrough treatments for diabetes. Few have been able to keep up with Novo Nordisk in this area. The company is also developing therapies in other areas, including various rare illnesses, Alzheimer's disease, and more. Having crushed the market for years, Novo Nordisk isn't about to stop now as its ability to develop new therapies -- a key factor behind its success -- is alive and well. 

2. Amgen

Although Amgen has outperformed the stock market this year, the company's financial results haven't been that impressive. In the third quarter, the drugmaker's revenue decreased by about 1% year over year to $6.7 billion. Some of the company's legacy products are seeing their sales drop due to competition. That includes rheumatoid arthritis medicine Enbrel, whose revenue during the third quarter decreased by 14% year over year to $1.1 billion.

Despite these headwinds, focusing on the long game is essential. Amgen has earned important approvals in the past couple of years, and it is well positioned to continue doing so. Some of its most important new medicines include cancer drug Lumakras, which first earned the green light in the U.S. in May 2021.

Tezspire, an asthma treatment, first got the nod in the country in December 2021. And in addition to its already rich pipeline, Amgen recently announced some acquisitions that will help it down the line. In October, the biotech acquired ChemoCentryx, a drugmaker focused on autoimmune diseases, for $3.7 billion in cash.

The key asset from this transaction is Tavneos, which was first approved in October 2021 in the U.S. to treat vasculitis, a rare autoimmune disorder. Some analysts see Tavneos' annual potential at roughly $2 billion by 2030. More recently, Amgen announced it would acquire Horizon Therapeutics, a rare-disease-focused biotech, for $27.8 billion in cash.

The transaction should close by the first half of 2023 and help Amgen expand its lineup and pipeline. Another one of Amgen's business units looks promising, namely its biosimilar segment. According to a Kaiser Family Foundation study, in the U.S., 83% of adults say that the cost of prescription meds is unreasonable. Biosimilars often offer cheaper options for groundbreaking but expensive medicines and, as such, have helped patients and the U.S. healthcare system save billions over the years.

Amgen is currently working on several biosimilars, including one for cancer medicine Stelara, marketed by Johnson & Johnson, another for eye-disease therapy Eylea, commercialized by Regeneron, and another for Soliris, which is owned by a subsidiary of AstraZeneca and treats a rare blood-related disease called paroxysmal nocturnal hemoglobinuria.

Be it through its development of brand-new medicines or biosimilars, Amgen has plenty of candidates to replace its older products and jump-start revenue growth. That will allow the pharma company to remain successful for a while.