Some interesting work by four economists at Berkeley contains the results of on experiment designed to figure out if relative pay affects job satisfaction. The results are as you might expect, and it is good to see them documented:
Economists have long speculated that individuals care about both their absolute income and their income relative to others. We use a simple theoretical framework and a randomized manipulation of access to information on peers' wages to provide new evidence on the effects of relative pay on individual utility. A randomly chosen subset of employees of the University of California was informed about a new website listing the pay of all University employees. All employees were then surveyed about their job satisfaction and job search intentions. Our information treatment doubles the fraction of employees using the website, with the vast majority of new users accessing data on the pay of colleagues in their own department. We find an asymmetric response to the information treatment: workers with salaries below the median for their pay unit and occupation report lower pay and job satisfaction, while those earning above the median report no higher satisfaction. Likewise, below-median earners report a significant increase in the likelihood of looking for a new job, while above-median earners are unaffected. Our findings indicate that utility depends directly on relative pay comparisons, and that this relationship is non-linear.
Put it on the top of your "to-read" pile. When I dig into it, I'll be looking to see how they controlled for objective measures of how productive the employees were. You can be overpaid and yet below the median of your peers, and you can be underpaid and yet above the median of your peers.