It has been suggested that bacterial cells communicate by releasing and sensing small diffusible signal molecules in a process commonly known as quorum sensing (QS). It is generally assumed that QS is used to coordinate cooperative behaviours at the population level. However, evolutionary theory predicts that individuals who communicate and cooperate can be exploited. Here we examine the social evolution of QS experimentally in the opportunistic pathogen Pseudomonas aeruginosa, and show that although QS can provide a benefit at the group level, exploitative individuals can avoid the cost of producing the QS signal or of performing the cooperative behaviour that is coordinated by QS, and can therefore spread. We also show that a solution to the problem of exploitation is kin selection, if interacting bacterial cells tend to be close relatives. These results show that the problem of exploitation, which has been the focus of considerable attention in animal communication, also arises in bacteria.