Being a doctor pays well, but there are still major discrepancies when it comes to paychecks within the medical profession, a new physician survey shows. For the first time, the annual report looked at race as well as gender and other factors, revealing some significant disparities in pay.

Medscape’s 2017 Physicians Compensation Report asked 19,200 physicians across 26 areas of medicine questions about annual compensation, race, gender, geography and job satisfaction.

Physicians’ annual salaries averaged $294,000, with specialists earning about $100,000 more than primary care doctors. Overall, average pay has risen by $88,000 over the seven years Medscape has been conducting this survey — an increase attributed to intense competition for doctors among hospitals and health care systems.

Get Breaking News Delivered to Your Inbox

The three highest-paying specialties were orthopedics (average annual compensation: $489,000), plastic surgery ($440,000) and cardiology ($410,000). They earned well over twice as much as the average pediatrician ($202,000) and family physician ($209,000), the two lowest-paying categories.

A deeper dive into the data shows male doctors take home bigger paychecks in both primary care and specialty areas such as orthopedics and surgery. Male primary care physicians made 15 percent more than women in 2016, while male specialists earned 31 percent more than their female colleagues.

Part of the reason may be that women are more likely to choose lower-paying specialties, said the report’s editor Leslie Kane, senior director of Medscape Business of Medicine.

“One of the things we look at is why there is this overall disparity. We look at what specialties women are going into and they go into less well-paying areas. Fifty-three percent of pediatricians are women, one of lowest paid specialties. Thirty-nine percent of family physicians are women, also a lower-paying area,” Kane told CBS News.

When it comes to the more highly paid medical specialties, only 9 percent of women are orthopedists and only 20 percent of general surgeons are female, said Kane.

The annual compensation survey delved into race for the first time, said Kane, who has edited the report for seven years. The results showed that African-American physicians earn 15 percent less than whites — $262,000 compared to $303,000. The survey notes that a higher percent of African-American doctors are in primary care rather than specialties.

African-American doctors are also less likely to say they feel fairly compensated, with only half agreeing that they’re earning what they should.

“Fifty-percent of African-American physicians don’t feel fairly compensated,” said Kane.

Racial and gender discrimination may certainly be a factor, Kane said, but there are other factors as well. For example, if a doctor treats more Medicaid patients, their reimbursement is usually lower, since employer-insured patients tend to pay better. How many hours a doctor works and whether they’re in private practice or a clinic can also explain some inequities in pay.

“Tons of factors play into how much a physician makes,” she said.

The survey found that the gender pay gap is smaller among younger doctors. Male doctors ages 55 to 69 make 27 percent more than women, but the divide shrinks to 18 percent in physicians under the age of 34.

While some might expect upscale urban and suburban areas — think Beverly Hills or Manhattan’s Upper East Side — to be home to the most well-paid physicians, the report actually showed higher salaries in rural states. Doctors in North Dakota are the highest paid in the U.S. followed by Alaska, South Dakota and Nebraska. (Washington D.C. is lowest, while New York hovers toward the bottom of the list.) Chalk that up to supply and demand: plenty of doctors cluster in big cities, while rural areas need to offer more money to attract staff.

Patients may be glad to know that regardless of pay, most doctors like what they do: eight out of 10 physicians said they’d still choose medicine if they had the chance to pick a career all over again.