Economists understand that markets often generate side effects, or externalities, for society, and these externalities affect the amount of value that markets create for society. When side effects are present, the government can use taxes (and subsidies, technically) to make society better off. Such taxes are called "Pigouvian taxes," and Robert Frank gives a nice overview of how they work and how they could be used to make everyone happier.


Comments
Surely the best kind of Pigouvian tax is Henry George’s Land Value Tax.
Both G. Mankiw and M. Freedman recommend it as being ideal.