The answer to how a doctor should tell a patient they need to lose weight would be entirely dependent upon the patient (the recipient of the info). Their reaction will be based on past experience, their mental health status, and their personality.
In a perfect scenario, the doctor would have had a good relationship with the patient and they can have an honest, productive discussion. But, we live in the real world where patients are often part of the assembly line of healthcare. So, the doctor wouldn't know the patient well enough to know how best to approach with the patient in front of them.
In my opinion, there is no perfect way to approach the subject. And I agree with anonbaribabe (above) that doctors are obligated to educate their patients about their health, the risks involved, and their options to treat.
My advice, take the approach of being informative and try to be empathetic. You won't win them all, but you'll win some. Besides, your conscience can be clear that you did the best you could.
In my own personal experience, I didn't like being told I was overweight. It's not like I didn't KNOW, it just stings to have someone else point it out to me and it was a blow to my self esteem. At my worst, I was guilty of avoiding doctors primarily for that reason. I didn't really want to face it.