When an activity results in a negative externality (external cost), the market outcome will not be efficient. In these cases, the government may choose to intervene in the market and impose some form of regulation, for example, a legal restriction or a tax. If the external cost the activity creates is borne by those who conduct the activity, the market outcome will be efficient.
For example, if a firm dumps its waste into a river, it pollutes the river and creates a negative externality (external cost) for those downstream. The government may intervene to restrict dumping in the river, or it may impose an effluent tax (a tax on each unit of pollution released into the river). If the firm is forced to pay for the pollution it releases into the river, it will dump less. A sufficiently high tax will lead to the optimal reduction in river pollution from the firm. Thus, the firm has internalized the externality.
However, in some situations, it may not be necessary to regulate a market to achieve an efficient outcome. It may be possible for the parties affected by an externality to negotiate an efficient outcome on their own. For example, if people who use the river downstream can negotiate with the polluting firm, they may be willing to pay the firm to stop polluting. This idea is embodied in the Coase Theorem, which states that if those who are affected by an externality can negotiate, they may arrive at an efficient solution to the externality problem.