STATES AND cities cannot prevent the Trump administration from doing damage on climate change policy, but they can mitigate the harm through global warming policies of their own.

Thankfully, many are doing so, showing by example that fighting climate change does not have to come at an intolerable cost. Recently announced climate initiatives in Virginia and the District offer a sense of how that is done.

Some of the most common greenhouse-gas emissions policies are really second- or third-best approaches. States and cities that directly subsidize renewables or require certain amounts of their electricity to come from particular sources unnecessarily close off other options that could be cheaper and just as effective. The best policies keep any and all emissions-cutting pathways open, enabling the least costly ones.

Economists have known how to do this for decades: Put a steadily rising price on carbon emissions. Consumers and businesses would respond over time by wasting less energy and favoring low-carbon products and services. Private economic activity would naturally sort out how much to rely on renewables, energy efficiency and other emissions-cutting measures, maximizing freedom, minimizing costs and cutting greenhouse gases.

Virginia Gov. Terry McAuliffe (D) embraced this approach, announcing this month that his administration will seek to price the state’s emissions by placing a cap on them and demanding that utilities turn in permits in order to emit greenhouse gases under that cap. The permits would be buyable and sellable, creating an effective price on carbon pollution. Better yet, the governor would seek to link Virginia’s program with carbon-trading markets in other states, creating a larger and more efficient market for permits.

In the District, meanwhile, local environmental activists have united around a plan to tax carbon emissions, starting at $20 per ton in 2019 and rising to $150 per ton in 2032, by which point the activists estimate the policy would have cut the city’s carbon emissions by 23 percent.

The primary objection to such plans is that they are regressive, hitting the poor harder than the rich, to whom the carbon price would feel relatively modest. Both plans have provisions offsetting this effect, with the District’s being particularly well thought out. Most of the money it would raise would be rebated directly back to residents. All but the wealthiest households would be made whole or better.

Neither plan is perfect. By necessity, Mr. McAuliffe is seeking to impose his cap-and-trade program over the head of the legislature, when it could be more cleanly designed if the General Assembly would buy in. The District’s plan would divert some of the money it raised to a green infrastructure fund that could well be spent on pet projects rather than effective climate initiatives.

But pricing carbon is the right approach. Other states should embrace the concept. The more that do, the more effective the policy will be.