A scramble for natural gas is creating pockets of scarcity in the global market, boosting prices for the fuel and for the electricity generated by burning it.

Rampant demand in China is sucking in chilled cargoes of gas from the U.S., after a year in which American energy companies throttled back production. A drought in Brazil has added to the competition by curtailing power output from hydroelectric dams.

Searing heat in Canada and the Pacific Northwest has also lifted gas demand. Some places are missing out, like Pakistan, where a shortage of gas and the delayed onset of the summer monsoon have prompted power outages.

Europe, in particular, is feeling the pinch. With vessels of liquefied natural gas heading to Asia, buyers on the continent have struggled to replenish tanks and caverns after a long and cold winter. Storage levels are the lowest for this time of year in a decade, said Natasha Fielding, a gas analyst at Argus Media.

The price of gas at a trading hub in the Netherlands shot to a record $13.10 per million British thermal units in July, according to S&P Global Platts data going back to 2004. Barring mild temperatures this winter, gas prices are likely to remain elevated globally for at least another year, according to Chris Midgley, head of analytics at the commodities-data firm.

“There just isn’t enough [liquefied natural gas] to supply Europe,” Mr. Midgley said. “The LNG, of course predominantly coming out of the U.S., is being pulled into Asia and also into Latin America.”

High prices for gas, coal and emission permits—the main input costs for power plants—have fed off each other to send electricity markets skyward too. In Germany, Europe’s largest economy, power prices in July jumped to about €83.67, equivalent to around $99.26, a megawatt-hour, according to Argus. That is close to their highest level in figures dating back to 2000. U.K., Spanish and Italian power prices have shot to record highs.

Monthly European electricity pricesSource: Argus MediaNotes: Prices are for month-ahead baseload power. €1=$1.19.
a megawatt-hourU.K.GermanyFrance2001’05’10’15’200102030405060708090100110€120

The moves are among the most extreme cases in a broader upswing in energy markets. U.S. crude prices have risen 54% this year to about $75 a barrel and Americans drivers are paying more for gasoline than they have done in almost seven years. Thermal coal hasn’t been as expensive in a decade.

For consumers and businesses, it is a painful reminder that energy bills can go up as well as down. The jump is driving a quicker pace of inflation, though central banks say that effect will wash out.