Bacteria commonly live in communities on surfaces where steep gradients of antibiotics and other chemical compounds routinely occur. While many species of bacteria can move on surfaces, we know surprisingly little about how such antibiotic gradients affect cell motility. Here we study the behaviour of the opportunistic pathogen Pseudomonas aeruginosa in stable spatial gradients of a range of antibiotics by tracking thousands of cells in microfluidic devices as they form biofilms. Unexpectedly, these experiments reveal that individual bacteria use pili-based ('twitching') motility to actively navigate towards regions with higher antibiotic concentrations. Our analyses suggest that this biased migration is driven, at least in part, by a direct response to the antibiotics. Migrating cells can reach antibiotic concentrations hundreds of times higher than their minimum inhibitory concentration in a few hours and remain highly motile. However, isolating these cells - using fluid-walled microfluidic devices that can be reconfigured in situ - suggests that these bacteria are terminal and not able to reproduce. In spite of moving towards their death, we show that migrating cells are capable of entering a suicidal program to release bacteriocins that are used to kill other bacteria. Our work suggests that bacteria respond to antibiotics as if they come from a competing colony growing in the neighbourhood, inducing them to invade and attack. As a result, clinical antibiotics have the potential to serve as a bait that lures bacteria to their death.