Warren Buffett is known for saying that it is far better to pay a fair price for a wonderful company than to buy a fair company at a wonderful price. Often times, determining value depends a lot on how good the business you’re considering investing in is.

Canadian National Railway Company  (TSX:CNR)(NYSE:CNI) is one company that I believe is a wonderful business. But, like all businesses, it experiences good times and bad times. But what matters is the company’s ability to continue pushing forward with investment, growth, and distribution of earnings to investors.

And the business is doing well. Its trailing 12 months saw it earn $3.6 billion in net income, and in that same time it had $2.5 billion in free cash flow, numbers which show that the business is in good shape.

But here’s the problem…

The economy has slowed down some, which forced the company to lower its annual profit target. It was expecting 4-6% growth, whereas now it expects earnings to be equal to last year’s.

But more specifically, what’s driving this drop in earnings is the commodity market. Companies were desperate to get their oil and coal shipped via railroad as quickly as possible because there was so much profit to be made. Now with prices in the sewer, companies are looking for cheaper alternatives.

Low oil prices are a double-edged sword. On one hand, it’s cheaper for the railroads. On the other hand, it’s cheaper for truckers, which makes trucking a viable alternative to railroads.

But it’s not all bad news. There remains consistent strength in the intermodal freight business, the forestry industries, and the U.S. automotive sector. So long as those industries continue to stay strong, I anticipate that Canadian National Railway will be in a strong enough position to weather low commodity prices.

There’s another reason why I like this stock.

It’s got an incredible rail network that has a tri-coastal layout, ensuring that it can ship goods from any part of Canada down to the Gulf of Mexico without having to switch trains. Most American companies need to switch in Chicago, adding delays.

Further, its capacity is growing stronger at many ports. For example, it has an exclusive deal with the Port of Prince Rupert (owned by DP World of Dubai), the world’s fastest-growing port. Further, its access in Mobile, Alabama, only grows stronger.

There’s no denying that market conditions certainly don’t favour Canadian National right now, and there are plenty of headwinds that it is going to have to deal with. If you already own this stock, I don’t advise selling it unless you believe there is a better price to be had. However, I’m not a trader; I buy and hold great companies, and I think Canadian National Railway is a great long-term company. On the other hand, if you can time the market, maybe you can find a better price.

All in all, I like Canadian National Railway. And I believe investors should be perfectly comfortable with the nearly 2% yield that it pays along the way.

Motley Fool issues rare "double down" stock alert

Not to alarm you but you recently missed an important and rare event. Stock Advisor Canada issued a "double down"... and history suggests it pays to listen. Because 10 of the most lucrative "double downs" in one of the Motley Fool's premier services skyrocketed an average of 434%! So, simply click here to discover why Motley Fool "double downs" have some investors rocking with excitement. Five years from now, you'll wish you'd grabbed this stock. Click here to learn more.

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Jacob Donnelly has no position in any stocks mentioned. David Gardner owns shares of Canadian National Railway. The Motley Fool owns shares of Canadian National Railway. Canadian National Railway is a recommendation of Stock Advisor Canada.