WASHINGTON — The political attack ad that ran recently in Arizona had some familiar hallmarks of the genre, including a greedy villain who hogged sweets for himself and made children cry.But the bad guy, in this case, wasn’t a fat-cat lobbyist or someone’s political opponent. He was a solar-energy consumer.Solar, once almost universally regarded as a virtuous, if perhaps over-hyped, energy alternative, has now grown big enough to have enemies.The Koch brothers, anti-tax activist Grover Norquist and some of the nation’s largest power companies have backed efforts in recent months to roll back state policies that favor green energy. The conservative luminaries have pushed campaigns so far in Kansas, North Carolina and Arizona, with the battle rapidly spreading to other states.Alarmed environmentalists and their allies in the solar industry have fought back, battling the other side to a draw so far. Both sides say the fight is growing more intense as new states, including Ohio, South Carolina and Washington, enter the fray.At the nub of the dispute are two policies found in dozens of states. One requires utilities to get a certain share of power from renewable sources. The other, known as net metering, guarantees homeowners or businesses with solar panels on their roofs the right to sell any excess electricity back into the power grid at attractive rates.Net metering forms the linchpin of the solar-energy business model. Without it, companies say, solar power would be prohibitively expensive.The power industry argues that net metering provides an unfair advantage to solar consumers, who don’t pay to maintain the power grid although they draw money from it and rely on it for backup on cloudy days. The more people produce their own electricity through solar, the fewer are left being billed for the transmission lines, substations and computer systems that make up the grid, industry officials say.