The gender pay gap is a fact of life for doctors, too.

About half of all male physicians claim a net worth of $1 million or more, compared with only a third of their female counterparts. That's according to a new Medscape report that collected data from nearly 20,000 physicians in 26 specialties from November 2015 to February 2016.

While 20% of male doctors say they have a net worth of between $2 million and $5 million, only 12% of women do.

A big reason for the discrepancy: Female doctors make a lot less than their male peers -- about 24% less.

Self-employed male physicians make about $341,000 a year, while their female counterparts make roughly $261,000. For doctors employed by hospitals or other large organizations, the gap is smaller but still significant -- men make about $277,000 and women make $217,000.

Even among primary care providers, "where the playing field is more level," men still make about 15% more than women, the report said.

Related: Doctors here make $472,000

About 30% of all physicians are women, and most tend to work in specialties that are less lucrative. But there is a big pay gap even within specialties.

A different physician survey found the biggest pay gap in ophthalmology. Men in that field earned 36% more than women -- a difference of about $95,000, according to Doximity, a networking service for doctors. The narrowest pay gap was a 12% difference found among anesthesiologists.

Medscape asked physicians to calculate their net worth by accounting for all of their assets as well as mortgages, loans and debt. The report also notes that male and female doctors tend to have similar spending habits and debt levels, making those factors less likely to account for the disparity in their net worth.