This paper analyses the economic impact of and the optimal policy response to energy supply shocks in a flexible price model with heterogeneous households. We introduce energy as a consumption good on the demand side and as an input to production on the supply side. A distinguishing feature is that, in line with empirical evidence, we allow households‘ energy demand to be non-homothetic. The model provides three main insights. First, (negative) energy supply shocks act as a (negative) demand shock, or Keynesian supply shock, when three conditions are met: (i) household income heterogeneity is intermediate, neither too high nor too low; (ii) the fraction of poor and credit-constrained households is high and (iii) competition between firms is strong enough. Second, implementing the first-best allocation requires subsidising the poor and taxing the rich, and more so when the economy faces a negative energy shock. Last, issuing public debt can be part of the optimal policy response to a negative energy shock, if the shock is large and the economy‘s overall energy intensity is low.