There is an interesting discussion over at Drugmonkey's blog about whether it is possible to teach things like resilience and ambition to students. In my opinion, the answer is no. Similarly, I don't think it is possible to teach our students a strong "work ethic". By work ethic, I mean the desire to work/study hard to get results and to take pride in one's work, regardless of the public reward. By the time students get to us (typically 18 at the youngest), I think such traits are set. They may even be set to some degree at birth (that is, it comes more naturally to some people than others, and is harder to teach some kids than others).
The one thing these traits have in common is the DESIRE to use strategies that can be taught. Coping strategies can definitely be taught, but the desire to use them (i.e. resilience) can not. Career development strategies can be taught, but the desire to use them (i.e. ambition) can not. Work/study skills can be taught, but the desire to work hard/study hard and to take pride in one's work (i.e. work ethic, for lack of a better term) can not.
This is something I always suspected, but my opinion has been reinforced by the experience of raising my own children. It is really hard to convince some children (even if they are very young, even if you are providing assistance, even if you are modeling the next step) that they should want to cope with adversity instead of giving up. Other kids just jump right up and keep going without any additional input. For very young kids, I think it is possible to teach such traits (resilience, ambition, work ethic), but it certainly helps that with kids one can enforce something like resilience until it becomes more natural.
Becca has a great comment listing out things an advisor can do to help a group member who is facing adversity, but doing any or all of those things will not make a person WANT to continue on. Since moving to ProdigalU, I have seen students offered every possible assistance and quit anyway, and I have also seen students suffer with the double whammy of negative life experiences (research or otherwise) plus poor mentoring and still finish their degree and go on to great opportunities. Part of what I attempt to screen for when interviewing potential group members is persistence/resilience because it is so important in research (much more important than GPA!), and I don't think it can be taught.
I try to set up a supportive environment. I don't ever dress down students in public. When good things happen, I am happy with my students, when bad things happen, I try to help them get through it. I remind students that a rejection is about the opinions of a few people in the world, that many great ideas were first rejected (not that all rejected ideas are great, though :-), that business is business and personal is personal (and rejection is clearly business!), that failing at something is not the end of the world. I share coping strategies, and I am clear about the ups and downs about life at ProdigalU (and also at life at all the places I was before).
This goes for both my research group and my classes (to varying degrees, of course). My more resilient students probably don't need this (but hopefully it helps them feel supported). My less resilient students hopefully learn more about how to keep going. My non-resilient students quit (which may be the right thing for them to do--if they decide my field is not for them due to lack of interest, it is definitely the right thing to do). I am sure I fail some of my students, since I am not a perfect human being, nor I am I the best mentor for every personality type. I know that I have helped students who wanted to keep going, but didn't see a way forward. I don't think I have ever convinced a student who didn't want to keep going to use the mechanisms in place to help them.
UPDATE: I haven't been at ProdigalU that long, and have a small group. All of my grad students thus far have left with a degree. When I talk about students quitting, it is students in my classes, or students I am a committee member for.