I study a gift-exchange game, in which a profit-maximizing firm offers a wage to a fair-minded worker, who then chooses how much effort to exert. The worker judges a transaction fairer to the extent that his own gain is more nearly equal to the firm’s gain. The worker calculates both players’ gains relative to what they would have gained from the “reference transaction,” which is the transaction that the worker most recently personally experienced. The model explains several empirical regularities: rent sharing, persistence of a worker’s entry wage at a firm, insensitivity of an incumbent worker’s wage to market conditions, and—if the worker is loss averse and the reference wage is nominal—downward nominal wage rigidity. The model also makes a number of novel predictions. Whether the equilibrium is efficient depends on which notion of efficiency is used in the presence of the worker’s fairness concern, and which is appropriate to use partly depends on whether loss aversion is treated as legitimate for normative purposes.