can they pay professors in different departments very different amounts?
Absolutely. The baseline salary for a given rank varies across divisions (salaries in STEM fields start higher than in the social sciences, which in turn pay better than humanities) and varies across schools (law and medical schools pay better than arts and sciences, since the former compete directly with the private sector). More importantly, faculty compensation is negotiated on an individual basis, and deans have tremendous leeway in how much they can offer to retain talent in the face of competing offers. At a first- or second-tier research university it's typical for star faculty to have a salary that's 2x or 3x the department baseline (or more).
Absolutely. The baseline salary for a given rank varies across divisions (salaries in STEM fields start higher than in the social sciences, which in turn pay better than humanities) and varies across schools (law and medical schools pay better than arts and sciences, since the former compete directly with the private sector). More importantly, faculty compensation is negotiated on an individual basis, and deans have tremendous leeway in how much they can offer to retain talent in the face of competing offers. At a first- or second-tier research university it's typical for star faculty to have a salary that's 2x or 3x the department baseline (or more).