Not so long ago, Ford Motor Company (F 0.08%) was an investor darling. Under now-retired CEO Alan Mulally, Ford avoided a government bailout during the economic crisis and emerged with a much-improved product line. Strong sales and profits followed, and shareholders were duly rewarded.

But in the past couple of years, Ford has fallen out of favor, on perceptions that it has fallen behind new and old rivals in developing the new technologies that threaten to disrupt the traditional auto business. But as we'll see, those perceptions might not be entirely valid. 

General Motors (GM -0.04%) is following a different path. Completely revamped following its 2009 bankruptcy, GM under CEO Mary Barra isn't seen as behind at all: In fact, it has recently become clear that GM is among the leaders in developing electric vehicles and self-driving systems. 

And when it comes to the present or the future of autos, one can't count out Toyota (TM 1.07%). Toyota has been hesitant to enter the electric-car race, but it leads the world in gasoline-electric hybrids -- and it may be on the verge of a breakthrough in battery technology. 

Since this is The Motley Fool, you know the question: Which of the three is the best buy now?

A red 2018 Chevrolet Equinox crossover SUV on a suburban street.

General Motors' line of all-new crossover SUVs have been well received and are already having an effect on GM's bottom line. Image source: General Motors.

By the numbers: Ford, GM, and Toyota 

Here's how the three stack up on some key measures.

Metric Toyota Ford  General Motors
Vehicles sold 10.3 million 6.6 million 9.8 million
Earnings before interest and tax (EBIT) $17.95 billion $8.8 billion $12.0 billion
EBIT margin 6.9% 5.7% 7.7%
Earnings per share $11.39 $1.60 $5.81
Price-to-earnings ratio 11.2 8.0 7.2
Dividend yield 3.15% 4.77% 3.72%

Data sources: Toyota, Ford Motor Company, General Motors, and Thomson Reuters. Sales totals are for the last four quarters combined and include sales by unconsolidated joint ventures in China. Financial figures are for the period beginning on October 1, 2016 and ending on September 30, 2017. EBIT excludes the impact of one-time items. Results for General Motors exclude costs and charges related to the sale of Opel AG. 

All three are giant global automakers, but Toyota and GM are a size up from Ford. All three pay good dividends that should be sustainable through a moderate recession. Toyota and GM have CEOs with strong track records; Ford CEO Jim Hackett took the job in May and hasn't quite put his stamp on the company yet, but his senior executives are all highly regarded veterans

All three are healthy, with competitive products, solid profits, and modest levels of debt. But looking at the numbers, a few things stand out: Ford's dividend, GM's margin, and Toyota's size.

Let's take a closer look.

How they're positioned for growth

I'll start with GM, because the company has recently made a strong case for itself. GM is thought to be among the leaders in self-driving technology, and it was the first to bring a long-range mass-market electric vehicle to market. Meanwhile, it's selling lots of high-profit-margin trucks and SUVs in the U.S. and (increasingly) in China. 

As GM sees it, that's a potent combination: Its technological lead could make it among the first movers in the soon-to-be-big business of automated urban ride-hailing, while it'll likely continue to sell lots of trucks and SUVs to its non-urban customers for decades to come. Because the urban ride-hailing is unlikely to cannibalize GM's existing business to any significant extent, the argument is that the current business plus the new business will add up to a significant jump in profits over the next several years. 

With Ford, the case is less clear. Like GM, it's selling lots of high-profit trucks and SUVs here in North America -- but its sales lag GM's in China, and it has recently lost ground amid perceptions that its product line is getting stale. It won't have a long-range electric vehicle on the market until 2020, and while its self-driving effort is well-funded and led by experts, it's likely to lag GM by a couple of years on that front as well. And unlike GM, Ford hasn't yet explained how (or whether) it expects to profit from these future-tech efforts. 

A row of Ford Fusion Hybrid sedans with Argo AI logos and visible self-driving sensor hardware, parked in a garage.

Ford owns a majority stake in Argo AI, a self-driving start-up founded by respected artificial-intelligence experts. Argo AI is leading the development of Ford's self-driving software. Image source: Ford Motor Company.

The wild card with Ford is Hackett: He's not your usual auto CEO. Hackett is a deep thinker who has given considerable thought to technological disruption and how the future could unfold for the auto industry. But it's still early in his tenure, and the path he plans to follow isn't clear to investors yet. 

And Toyota? Until recently, Toyota didn't seem interested in battery-electric vehicles. Executives were convinced that the high costs and long recharging times would limit consumer adoption of battery-powered vehicles, and that hydrogen fuel cells were a better bet. Toyota is still investing in fuel-cell technology, but the company's tune changed very recently: Toyota now says it'll have at least 10 fully electric models available worldwide in the early 2020s. 

A dark blue Toyota Mirai fuel-cell sedan.

Toyota often goes its own way, sometimes with great success. Its electric Mirai sedan is powered by a hydrogen fuel cell rather than batteries. Image source: Toyota Motor Corporation. 

Why the change? One possibility: There have been growing hints that Toyota may have figured out "solid-state" battery technology. Unlike current batteries, solid state lithium-ion batteries don't overheat, aren't a fire risk, and can be recharged more quickly. They may also cost less to manufacture at scale. 

Toyota is exploring the idea of a battery-making joint venture with Panasonic, currently the world's leading maker of batteries for electric vehicles. If Toyota and Panasonic team up to make solid-state batteries and sell them to rivals, that could be a lucrative new business that gives Toyota's bottom line a big boost.

But right now, like Ford's, Toyota's profit margin lags GM's. Its stock is also the most expensive of the three, at just over 11 times earnings. 

Which one is the best buy?

I like GM a lot as an investment right now. It has had a decent run over the last several months, but it's still the cheapest of the three at just over 7 times earnings. It's making strong profits on its just-launched line of all-new crossover SUVs, it's about to launch all-new pickups, which should start to boost profit in early to mid-2019, and it's tantalizingly close to launching an automated urban ride-hailing service at scale.

I don't think you'd go too far wrong by buying either of the others. Toyota, with its established manufacturing prowess, strong R&D program, and millions of loyal customers, will be a major player in autos (or personal mobility) well into the future. That's likely true of Ford as well, and with Ford you get a fat dividend that should be sustainable through the next downturn, whenever it arrives. 

But GM also pays a good dividend, is well-managed, and has a clear path to significant profit growth. I think that makes it the best buy now.