Consumers are loading up on pasta, rice and bread. Farm supply lines are disrupted. Countries are restricting agricultural exports.

The result: Prices of wheat and rice, two of the world’s staple grains, are rising sharply. Difficulties moving grain within countries and across borders, coupled with frenzied buying, could exacerbate the impact of the pandemic on the global food market.

The...