The bulk of the radiative output of a solar flare is emitted from the chromosphere, which produces enhancements in the optical and UV continuum, and in many lines, both optically thick and thin. We have, until very recently, lacked observations of two of the strongest of these lines: the Mg II h & k resonance lines. We present a detailed study of the response of these lines to a solar flare. The spatial and temporal behaviour of the integrated intensities, k/h line ratios, line of sight velocities, line widths and line asymmetries were investigated during an M class flare (SOL2014-02-13T01:40). Very intense, spatially localised energy input at the outer edge of the ribbon is observed, resulting in redshifts equivalent to velocities of ~15-26km/s, line broadenings, and a blue asymmetry in the most intense sources. The characteristic central reversal feature that is ubiquitous in quiet Sun observations is absent in flaring profiles, indicating that the source function increases with height during the flare. Despite the absence of the central reversal feature, the k/h line ratio indicates that the lines remain optically thick during the flare. Subordinate lines in the Mg II passband are observed to be in emission in flaring sources, brightening and cooling with similar timescales to the resonance lines. This work represents a first analysis of potential diagnostic information of the flaring atmosphere using these lines, and provides observations to which synthetic spectra from advanced radiative transfer codes can be compared.