The legislation is unlikely to come into force for at least a year, meaning that customers face another winter with high energy bills.
Ahead of the publication, the government revealed the cap will apply to anyone on a standard variable tariff, the kind of expensive plan customers are moved to when their cheaper deals end.
A pledge to change the law was included in the Conservative manifesto before June's General Election, but was dropped from the subsequent Queen's Speech after some Tory MPs claimed it was state intervention and anti-free market.
"It has to offer fairer prices for millions of loyal customers who have been paying hundreds of pounds too much". It punishes loyalty - the independent competition authority found millions of people who are customers of the Big Six suppliers are overpaying to the tune of £1.4 billion a year.
In the meantime, we expect suppliers to do more to get customers on poor value default tariffs onto better deals.
Today Ofgem said it will work with the Government on these plans to make sure those on SVTs and default deals are protected.
In the meantime it said it was introducing new rules to allow suppliers to roll customers coming to the end of their contracts onto another fixed deal instead of a poor value standard variable tariff.
Around four million households already benefit from a limit on the cost of gas and electricity on pre-payment meters, with Ofgem saying that the price cap could be extended to seven million vulnerable households by next winter.
She said: "Due to the Government's dithering, the four million households in fuel poverty - nearly one million of which includes a disabled person - will face another winter of cold homes and astronomical bills".
Labour's shadow business secretary, Rebecca Long-Bailey, described an energy price cap as a "suitable temporary measure" but claimed "the market as a whole needs to be reformed".