These are trying times for the logistics and shipping industries.

A confluence of factors mostly tied to the pandemic and its aftereffects have led to logjams throughout supply chains, and the pressure is beginning to boil over at U.S. ports. About half a million containers are sitting on cargo ships off the port of Los Angeles, waiting to be offloaded, and on the Atlantic coast in recent days, at times two dozen or more ships have been anchored off the coast of Savannah, Ga., waiting to deliver their cargoes

The issues at U.S. ports figure to ripple across a wide variety of industries, and that has some experts worried already about the forthcoming holiday shopping season. But the port congestion also figures to create opportunities for some companies set up well to profit when demand exceeds supply. Here's why three Fools expect Union Pacific (UNP -1.82%)Eagle Bulk Shipping (EGLE), Costamare (CMRE -1.47%) to power through this shipping crisis.

Aerial view of container ships waiting to dock.

Image source: Getty Images.

Union Pacific is on track to deliver

Lou Whiteman (Union Pacific): There are multiple chokepoints backing up the ports, from the number of available berths to labor shortages limiting how quickly the ships that are docked can be offloaded. But the issues go far beyond the ships: Ports are running out of places to stack containers awaiting transport to their final destinations. 

Union Pacific plays a major role in relieving that pressure point. About 25% of its total freight either originates from southern California or ends up there. And the company has felt the impact of the delays: Just 71% of intermodal containers -- those long, rectangular containers that can seamlessly go from ship to train or truck -- were delivered on time in the second quarter, down from 82% in the prior-year period. 

But even if the network is struggling under the load, Union Pacific's rails are the best solution to the ongoing crisis. The company has added thousands of employees and brought extra locomotives online in response to the surge in demand for transport. Its trains averaged 9,410 feet long in the second quarter, up 8% from a year earlier, and its workforce productivity jumped to 1,060 daily miles traveled per full-time employee from 868 miles in the same three months of 2020. 

And while the railroads haven't powered through this crisis without blemish, the rest of the transportation sector would do well to adopt some of rail's practices, including 24/7 operations. Rail companies have begun offering incentives to shipping partners to come get goods on weekends and take other steps to speed the system.

For railroads, the supply-demand imbalance should mean pricing power. Trucking companies offer an alternative transport method for these intermodal containers, but with drivers in short supply, trucking is in no position to absorb the added demand without raising its own prices. 

Union Pacific shares have gone nowhere in the last year, and the stock is trailing the S&P 500 by more than 20 percentage points over the past three years. During that time, the company increased its annual dividend per share by 56%, part of a campaign that returned more than $25 billion to shareholders. In the coming years, Union Pacific expects to repurchase another $18 billion to $19 billion worth of its stock. And those who buy in today will enjoy a dividend yield of nearly 2%.

The port crisis will clear eventually, and as it does, Union Pacific will be a big part of the solution. Investors buying in today get a company trading at a reasonable valuation that has room to run as added business comes its way.

The longer the waiting line, the more money this shipper makes

Rich Smith (Costamare): I'm not 100% certain if my pick this week, ocean-going container shipping concern Costamare, should be termed "unfortunate" or "perfectly timed" -- but I'm going to go with the latter.

Costamare's stock crashed by nearly 10% in price on Monday, you see -- its worst one-day decline in a year. And yet this looks more to me like a buying opportunity than a reason to panic.

Consider: The Freightos Baltic Index (which tracks the cost of container shipping) is currently down by about 5.3% from the all-time high it hit last month. The China Containerized Freight Index, however, is still trending higher -- it's up 1% over the same period. And when you consider how much container traffic flows from China to the U.S., that seems to me perhaps the more important gauge of the health of the container shipping industry, generally.    

Photo of a cargo ship at port.

Image source: Getty Images.

Nor do I see much prospect for container shipping prices falling any more -- not so long as West Coast shipping ports remain jammed with traffic, and not with The Wall Street Journal reporting that the port crisis has now spread to the East Coast, where the Port of Savannah in Georgia is struggling to clear "a backlog of more than 20 container ships."  

So long as container ship companies charge their customers by the day and not by the voyage, the costs attendant on all these delays accrue to the customer, while the profits accrue to companies like Costamare.

And we're talking big profits. Over the past 12 months, Costamare booked $520 million in revenue, its best result ever, according to data from S&P Global Market Intelligence. Operating profit margins are approaching 42% -- pretty close to the company's best-ever number, and enough to give Costamare its highest profit in history: $211 million.

It's little wonder, then, that Costamare stock is up 150% over the past year, even after Monday's decline. And with analysts forecasting total earnings growth of 44% over the next couple of years and no long-term solution to the port crisis in sight, I see every reason for Costamare stock to continue sailing higher.

A bulk buying opportunity

Rich Duprey (Eagle Bulk Shipping): The simple fact of the port crisis is that congestion is holding up ships, limiting their supply at a time of increasing demand. That makes each ship more valuable. And it's not limited to just container ships. Dry bulk shippers like Eagle Bulk Shipping, which operates one of the largest fleets of Supramax and Ultramax vessels in the world, are also feeling the impact. 

Rates on ships are approaching levels not seen since 2010. While Capesize ships (the largest dry bulk ships, with carrying capacities of 110,000 to 200,000 deadweight tons) are generating the greatest rate increases, midrange Supramax ships are experiencing significant rate expansion as well. The Baltic Exchange Supramax index is up over 330% in 2021.

The results of this are showing up in Eagle Bulk Shipping's financials. Second-quarter EBITDA was up 100% sequentially to $62.7 million, and adjusted net income exceeded $40 million -- four times what it earned in the first quarter. 

Even Eagle's asset values are rising, as values for 10-year-old Supramaxes were up 24% in the quarter and are up 75% year to date. Management noted that you would have to go all the way back to 2004 to see a larger increase in ship values over a six-month period.

As my Motley Fool colleague Rich Smith notes, China is also suffering from port delays, and their delays actually dwarf those being experienced in the U.S. At the end of August, almost 6% of the world's bulk fleet was stuck outside of Chinese ports, according to Lloyd's List -- approximately one out of every 20 of the 11,850 bulk carriers operating worldwide. 

If your ship is caught in port and unable to load, particularly when dayrates are exceeding $30,000, it's going to hurt revenue, but Eagle says the current situation has tremendously increased its fleet utilization.

The situation isn't going to improve anytime soon. Even if the backlogs caused by the pandemic and its aftereffects are reduced, Eagle CEO Gary Vogel points out that regulations mandate that over the next year and a half, shippers will need to install ballast water treatment systems on their fleets, which will take them out of service temporarily, putting further limits on the supply of available ships.

Dry bulk shipping tends to be cyclical, following the rise and fall of commodity prices, or in this case, the massive backups occurring at ports around the world. Boom times eventually give way to leaner periods, but this bull market in bulk shipping will persist for some time to come.