Resource competition is a fundamental interaction in natural communities. However, little remains known about competition in spatial environments where organisms are able to regulate resource distributions. Here, we analyse the competition of two consumers for two resources in a one‐dimensional habitat in which the resources are supplied from opposite sides. We show that the success of an invading species crucially depends on the slope of the resource gradients shaped by the resident. Our analysis reveals that parameter combinations, which lead to coexistence in a uniform environment, may favour alternative stable states in a spatial system, and vice versa. Furthermore, differences in growth rate, mortality or dispersal abilities allow a consumer to coexist stationarily with – or even outcompete – a competitor with lower resource requirements. Applying our theory to a phytoplankton model, we explain shifts in the community structure that are induced by environmental changes.