This paper derives the socially optimal transmission prices in a congested electricity network when there is imperfect competition in generation, and when the budget constraint of the network operator is binding. The results which we derive are a generalization of the standard Ramsey prices and also of the locational marginal prices (LMP). The model is illustrated with a numerical model based on the Belgian electricity data.