The impact on energy companies from the changes announced by the government on Friday was greater than expected and their shares fell sharply on the Madrid stock exchange.

A 26 billion euro (22.5 billion pounds) power tariff deficit created by years of mismatched regulated prices and costs has become a growing headache for recession-hit Spain and there is no painless way to pay it off.

The government is already struggling under one of the euro zone's biggest public deficits, bloated by a 42 billion euro bill for helping nine banks to recover from the 2008 property crash.

The recession has brought Spain an unemployment rate of 27 percent, cast many families into poverty and sparked social unrest.

A planned 3.2 percent rise in electricity bills for about 28 million consumers under the new energy regime can only worsen that hardship. Including this new increase, prices have surged 8 percent since the centre-right government of Prime Minister Mariano Rajoy assumed power in late 2011.

The government presented the plan as tough but necessary. It has been looking for months at how to plug the power deficit and share the burden between traditional electricity companies, renewable power producers, consumers and taxpayers.

"We are looking to correct a key imbalance in our economy," said Deputy Prime Minister Soraya Saenz de Santamaria. "This is the definitive answer to the woes of the electric sector in our country."

BURDEN SHARING

Subsidies for wind and solar electricity generation, and for providing power to remote islands, as well as production over-capacity have widened the power deficit over the past decade.

It was expected to keep growing by between 4 billion euros and 5 billion euros a year unless action was taken.

The government said it would cut the deficit by 4.5 billion euros a year through cost savings and price rises, leading to a far smaller contribution from the state. If the deficit appears again, it said, new price increases would kick in automatically.

It said the cost of the power tariff regime would be cut by 2.7 billion euros a year by reducing the fees charged by companies distributing and transporting electricity.

The government will scrap automatic subsidies to renewable power producers and bring in a new system of "reasonable profitability".

Under this regime, the annual profits of renewable power companies such as Acciona (>> Acciona SA) and Abengoa (>> Abengoa SA) will be capped at 7.5 percent a year.

Distributors such as Iberdrola (>> Iberdrola SA), Endesa (>> Endesa SA) and Gas Natural (>> Gas Natural SDG SA) will have earnings capped at 6.5 percent a year. Companies will also receive less from the state to maintain production capacity in gas-fired power plants.

A further 900 million euros a year is to be obtained by increasing consumer prices, with the remaining 900 million euros - equivalent to half of the cost of providing power to remote islands - covered directly by the state's annual budget.

POWER SHARES DROP

In 2013 the annual deficit is expected to swell by up to 3 billion euros, reflecting the absence of the new measures in the first six months of the year, an industry ministry source said.

That cost is to be shouldered by the companies, which will be able to recover it from electricity bills over the next 15 years, the source said.

Shares in renewable power producer Acciona dropped by 8.5 percent on Friday, while energy distributor Gas Natural lost 8 percent and power grid operator Red Electrica (>> Red Electrica Corporacion SA) fell 7,5 percent.

Other energy distributors Iberdrola, Enagas and Endesa lost between 3.4 percent and 6 percent.

Italy's biggest utility, Enel (>> Enel S.p.A.), fell 4.7 percent. Enel, which owns Endesa, had its credit rating downgraded by S&P on Thursday to BBB on weaker economic and industry conditions in its core markets of Italy and Spain. Enel Green Power (>> Enel Green Power SpA), the renewable group controlled by Enel, was down 3.4 percent.

Under the outgoing system, utilities have funded the power deficit and the government has been gradually paying them back through the issuance of state-backed bonds.

As part of the reform, the state will guarantee another 4 billion euros of bonds issued by FADE, a fund used to transfer the debt from the companies to state-backed institutions.

But the treasury ministry, keen to control any extra spending as it struggles to meet tough deficit targets agreed with the European Union, resisted pressure to take on any additional cost.

(Additional reporting by Madrid bureau; Writing by Julien Toyer; Editing by Tom Pfeiffer and David Goodman)

By Andrés González and Jose Elías Rodríguez