The manner in which a physician approaches delivering bad news depends in large part on the clinical scenario. Taking care of a really sick neonate in the NICU where support has been withdrawn is vastly different than informing the relatives of a fatal car crash victim.
In general, the sort of "standard practice" guidelines you'll find pretty readily include things like choosing an appropriate setting - a private room, some place away from other patients and visitors, a place where everyone can sit down. There is also an emphasis on making sure there's appropriate time to fully offer support and many experienced physicians will turn off their pagers/phones to prevent interuptions. Often it is a good idea to make sure that everyone the family wishes present is actually there - if the patient is dead, waiting 30 minutes to an hour for someone to make it back to the hospital isn't going to change things, but it might make the family infinitely more comfortable. Having hospital support staff such as nurses that have made a connection with the patient/family, social workers, and chaplains available - not always in the room, but available - is also important.
In terms of actually telling the news, again physician dependent, but explaining what happened that got you to that point, the interventions performed, and how long the resuscitation was attempted can be very important. Certainly there will be some doctors who go to the cliche "we did everything we could" and leave it at that. In part I think you have to be sensitive and read the family and consider what they're going to understand. For the sudden, unexpected deaths there is a growing body of literature that has come out in favor of having family members witness the ongoing resuscitation attempt, so they can see the effort that's been given for their loved one. From anecdotal experience, once the family sees the resuscitation effort, they often ask for the medical team to stop.
It is perfectly acceptable for physicians and health care providers to say "I'm sorry". You'll find that most of them give variations of "I'm sorry that this outcome happened" or "I'm sorry for your loss" shielding any sort of responsibility, but in a majority of States, there are legal protections and explicit rules that prevent attributing guilt or negligence to a healthcare provider who simply says "I'm sorry". Negligence/malpractice might have most certainly occurred, but just because the physician said "I'm sorry" would not put them in danger - the plaintiff would still have to demonstrate the malpractice.
The physician should also make demonstrating empathy a priority. Phrases like "I know how you feel" should be replaced by things like "I can only imagine how you must feel" - unless the physician has actually experienced the situation that has occurred. Allowing the family members to ask questions is important, and often times silence is the best practice - especially when you don't know what else to say. It's also important to allow the family to see the body, though some physicians prefer to have time to "clean up" the body - remove lines and instruments that were part of the resuscitation.
SPIKES is a research validated framework for delivering all types of bad news
http://theoncologist.alphamedpress.org/cgi/reprint/5/4/302
In more chronic cases, or scenarios in which there's a more gradual sense of the outcome, other strategies exist. Particularly in pediatrics, allowing parents to do some of the things they're used to doing allows them to feel some closure. In the PICU, that may mean giving a brain dead young patient (like under 4 years of age) a bed bath, or allowing them to dress the child with clothes from home. Quite often the parent is used to doing things like that and all of a sudden it becomes the nurses' responsibility, leaving the parent merely an observer. In the NICU, allowing the parents, if they want to, to hold their baby can be extremely important, some babies spend their whole life on the vent and the parents have never been able to hold them, so it's a valuable experience.
Sometimes, the best way to learn how to give bad news is to watch it done poorly.
In the end, the physicians that probably do the best job of giving bad news are the ones who consider it another opportunity to help their patient rather than something that they dread and want to get over with as quickly as possible. One of the things I've heard anecdotally is that many geriatrics fellowship enjoy having Med/Peds trained residents because they're so comfortable in talking with patient's families due to their pediatric training. But all told, it's about taking the time do it, and realizing that it is a skill, and while it's never going to be something to look forward to, it's one of the most important tasks in our field.