The prime minister says it would be "reckless" for resident doctors to strike with the NHS at a "precarious" moment.