We study consumer strategy, vendor strategy and their equilibrium in a duopoly market where vendors bear the costs in the production process. If consumers have an identical preference that is unknown, we obtain the equations satisfied by the total social surplus and the profit of each vendor. Moreover, we prove that the second derivatives of the total social surplus function and the profit function are continuous at the cutoff by the well-known conditions of value matching and smooth pasting. In a duopoly market, vendors can increase the total social surplus by adjusting their output, which causes fewer profits for vendors. However, rational vendors usually do not make such concessions, which implies that it is almost impossible to maximize total social surplus in a duopoly market. Thus, the planner needs to control vendors’ output to maximize the total social surplus. We obtain the planner’s optimal strategy and the socially efficient allocation. When vendors and consumers maximize their value, we find that the price of goods may be less than their costs due to price competition. By Bayesian learning and price competition model, we discuss a Markov perfect equilibrium and the relationship between the socially efficient allocation and the Markov perfect equilibrium.