Trust management is suitable for handling the internal security problems in wireless sensor networks. However, trust management schemes usually neglect the selfishness of normal nodes and regard malicious nodes as never cooperate. Thus, to ensure trustworthiness and encourage nodes to cooperate, incentive mechanisms are in pressing demand for trust management schemes. We propose an incentive mechanism based on game theory. The interactions between unknown-type nodes and normal nodes are modeled as Bayesian games. A set of parameters including players' action sets and the payoff matrix are formulated and analyzed. How a player can select proper actions on behalf of its own profits is shown by the equilibriums of the game. Simulation results show that the proposed incentive mechanism can effectively motivate normal nodes to cooperate instead of being selfish and compel malicious nodes to cooperate as far as possible. Copyright © 2014 John Wiley & Sons, Ltd.