In practice some companies do pay below the market rate by comparing the rate to that offered to a lower skill level - for example for a "senior" job hire a foreign senior developer as a "junior" thus be able to compare their salary to the average salary for a junior and underpay them.
Also the majority of market rate comparisions are done using the Bureau of Labor Statistics "Occupational Employment Survey" which people have argued undervalues certain jobs due to jobs with different requirements being lumped into a single category.
Since my parent post got voted down, I should probably note that I am on H1B and I've done this myself.
3 points by aristus:
"My wife's took 5 months, but then she married a local. :) But before that was a three-year tragicomedy with all the problems you bring up, plus another nasty one: the 'visa discount'. Large employers love to cut your salary by 15-20% if they can get away with it. What are you going to do? Quit?"