Instead, she said, the trick is workplace flexibility in terms of hours and location.

“The gender gap in pay would be considerably reduced and might vanish altogether if firms did not have an incentive to disproportionately reward individuals who labored long hours and worked particular hours,” she wrote in a paper published this month in The American Economic Review.

Occupations that most value long hours, face time at the office and being on call — like business, law and surgery — tend to have the widest pay gaps. That is because those employers pay people who spend longer hours at the office disproportionately more than they pay people who don’t, Dr. Goldin found. A lawyer who works 80 hours a week at a big corporate law firm is paid more than double one who works 40 hours a week as an in-house counsel at a small business.

Jobs in which employees can easily substitute for one another have the slimmest pay gaps, and those workers are paid in proportion to the hours they work.

Pharmacy is Dr. Goldin’s favorite example. A pharmacist who works 40 hours a week generally earns double the salary of a pharmacist who works 20 hours a week, and as a result, the pay gap for pharmacists is one of the smallest.

Pharmacy became such an equitable profession not because of activism but because of changes in the labor market (fewer self-owned pharmacies and more large corporations) and changes in technology (storing patient records on computers where they are easily accessible by any pharmacist).

In other jobs, workers have made these changes themselves. Conventional wisdom is that in jobs like surgery, employees cannot easily substitute for one another and must be on call.

But in one type of medicine, obstetrics, doctors have figured out another way. No longer are many obstetricians on call around the clock. If a baby arrives in the middle of the night, a doctor working an eight-hour shift at the hospital is likely to handle the delivery instead of the doctor who cared for the mother for 40 weeks.