The decision to consume or reject a food based on the degree of acidity is critical for animal survival. However, the gustatory receptors that detect sour compounds and influence feeding behavior have been elusive. Here, using the fly, Drosophila melanogaster, we reveal that a member of the ionotropic receptor family, IR7a, is essential for rejecting foods laced with high levels of acetic acid. IR7a is dispensable for repulsion of other acidic compounds, indicating that the gustatory sensation of acids occurs through a repertoire rather than a single receptor. The fly's main taste organ, the labellum, is decorated with bristles that house dendrites of gustatory receptor neurons (GRNs). IR7a is expressed in a subset of bitter GRNs rather than GRNs dedicated to sour taste. Our findings indicate that flies taste acids through a repertoire of receptors, enabling them to discriminate foods on the basis of acid composition rather than just pH.