One of the great things about investing in stocks is that there is no need to have millions in the bank to get started. A relatively modest sum such as $1,000 can go a long way if invested shrewdly. But with an abundance of options to choose from, it can be challenging to separate the wheat from the chaff.

For those needing inspiration, let's consider two stocks worth investing in: HCA Healthcare (HCA -2.37%) and DexCom (DXCM -9.90%). If you have a spare $1,000 that isn't being saved for something important -- such as bills or an emergency -- here is why putting that money into these companies would be worthwhile.

1. HCA Healthcare 

HCA Healthcare runs a business that most people will have to interact with at some point. The company is one of the largest hospital chains in the U.S. It ended the second quarter with 182 hospitals, unchanged from the previous year's comparable period. The inevitability of people needing HCA Healthcare services is one of the factors that make it an attractive stock.

Even during challenging times, people are unlikely to skip the medical care they need; it's one of the last things they'll skimp on. So the occupancy levels that are one of the sources of HCA Healthcare's revenue should remain somewhat stable regardless of economic conditions. Still, that doesn't mean the company is immune to economic challenges, as the past couple of years have shown. HCA Healthcare has had to deal with rising expenses due to inflation and labor issues, among other problems.

However, the stock has delivered solid returns throughout the ebbs and flows. One reason is that HCA continues to post financial results that are robust, though not always blowout-level. In the second quarter, revenue increase by 7% year over year to $15.9 billion. Key metrics were also on the rise, including same-facility admissions and emergency room visits. Earnings per share (EPS) of $4.29 jumped by 10% year over year.

Here's another reason to like HCA: The company has continued to gain market share against its competitors. It did so during the pandemic, going from 26.5% before the outbreak started to 28% as of the second quarter of last year. Market share gains of 1.5 percentage points in three years are meaningful in an industry this competitive.

Although the past is not a guarantee, HCA's ability to capture market share is a good sign. It has done so by improving its clinical capabilities, thus giving physicians more options to treat their patients, a win-win situation. It's a good bet that it can continue doing the same.

With its entrenched position in many communities around the country -- and the high barriers to entry in the healthcare industry (steep up-front costs and legal obstacles) -- HCA should remain a leader in its field for a while, making the company a solid buy-and-hold option. At current levels, $1,000 would get investors about three shares of HCA Healthcare at current levels. 

2. DexCom 

DexCom is helping fight the diabetes epidemic by developing continuous glucose monitoring (CGM) systems that allow people with this chronic illness to keep their blood glucose levels in check. Blood sugar significantly out of range can lead to serious, sometimes life-threatening complications for a diabetic.

CGM systems are superior to blood glucose meters (BGMs) since the former automatically make measurements throughout the day, as often as every five minutes. BGMs are manual, rely on painful jabs in the finger, and can only tell blood sugar levels at a point in time. That's why DexCom's devices, such as its flagship G6 system, have been linked with better health outcomes.

Adoption of this technology has helped DexCom push its revenue and earnings higher, even with fierce competition from Abbott Laboratories' FreeStyle Libre system. In the second quarter, DexCom's revenue increased 25% year over year to $871.3 million and its adjusted EPS doubled to $0.34.

Over the past year, DexCom has launched two new devices: the G7, successor to its G6, and the DexCom ONE. These are helping the company make progress in its existing geographies and break into new ones. For instance, the company entered the Latin American market in the second quarter (specifically Argentina) with the DexCom ONE, a cheaper CGM option that can help attract price-sensitive customers and make headway in regions with low CGM penetration.

And there is still a massive addressable market ahead, with 37.3 million diabetes patients in the U.S. alone. DexCom ended 2022 with an installed base of 1.7 million customers. Since it is one of the leaders in the field, this metric shows that there is ample white space ahead if the company continues doing what has helped it succeed: innovate and raise awareness for better ways to address diabetes, including CGM devices.

That should lead to solid financial results and stock market performance for a while. Investors can get about eight shares of DexCom with $1,000 -- money well spent.