The sun has been more restless lately. Scientists have been predicting an upswing in volatile solar behavior, and experts warn that “everything that plugs into a wall socket” could be at risk if the products of a “coronal mass ejection” hit the planet.

A huge coronal mass ejection hit the Earth in 1859, inducing dangerous sparks in telegraph offices, some of which burned to the ground. In 1921, the planet saw a similar episode.

But humans now rely much more on vast, interconnected electricity grids. A lesser solar event in 1989 knocked out electric power to millions in Quebec. A National Academy of Sciences study warned in 2009 that a large-scale geomagnetic storm could end electric power to millions and permanently damage power-grid equipment, costing up to $2 trillion during the first year of recovery. Even access to potable water and toilet facilities could be limited because the electric pumps that drive public water systems could be knocked out.

The world should do more to ensure that scientists have the tools they need to anticipate space weather. With some warning, for example, electrical grid operators can adjust the systems they control to avoid damaging “ground currents” induced by large coronal mass ejections. NASA maintains the Space Weather Prediction Center, though with a tiny budget. And funding constraints perpetually threaten to erode the coverage of satellite-based sensors that monitor all sorts of phenomena on Earth and elsewhere.

Congress has a poor record of remembering to keep these sorts of important scientific tools in mind at funding time. For a variety of reasons, lawmakers must take a wider view.