It has been noted in a recent report (Dec. 2002) from the General Accounting Office of the U.S. that "various design flaws in wholesale markets and transmission services have created operational problems within and between wholesale markets." This paper presents a novel methodology to analyze and design the wholesale energy bidding aspect of a deregulated power market. We adopt a system-wide approach that considers many of the relevant features including transmission congestion. We develop a two-stage model: 1) a nonzero sum stochastic game with average reward for the wholesale energy market operation, and 2) a nonlinear programming (NLP) model for the unit-commitment (UC) and the optimal power-flow aspects. The solution approach for the two-stage model is based on a reinforcement-learning (RL) algorithm, which is designed to obtain Nash equilibrium policies. We use a three-retailer/three-supplier power network with and without congestion to test and benchmark our methodology.