We study pricing strategies of competing firms selling heterogeneous products to consumers. Goods are substitutes and there are network externalities between neighboring consumers. In equilibrium, firms price discriminate based on the network positions and charge lower prices to more central consumers. We also show that, under some conditions, firms' equilibrium profits decrease when either the network becomes denser or network effects increase. In contrast, consumers always benefit from being more connected to each other. We determine the optimal network structure and compare uniform pricing and discriminatory pricing from the perspectives of firms and consumers.