It is possible for power plants to form coalitions so they can achieve more extra-profits. This paper investigates how to optimize the bidding strategies of generation companies with possible coalitions via n-person game theory and proposes a two-level optimization method to deal with the coordination strategy of coalition companies. The proposed method can guarantee the maximum profits of allied companies under the condition that non-allied companies can achieve their maximum profits too. Optimal allocation of the total profits is also discussed in this paper. Numerical example proves the effectiveness of the proposed method and shows that the coalition strategy is a key for optimization problem and that establishment of market rule should avoid the existence of improper coalition.