Hi, I'd like to help you with your question.
First, I am so sorry to hear about your daughter's friend. It is horrible to have anyone sick with cancer but a child with cancer is especially difficult.
I would start with talking to your daughter about how she feels. Let her express herself and her feelings about her friend and about what she understands so far. This will give you an idea of what she doesn't know and also how to talk with her about the situation.
Be honest with her. Children are quite perceptive and understand when someone is uncomfortable or possibly not telling the truth. Stay away from brutal honesty, but telling her the truth at her level such as "yes, your friend is sick. She does have cancer. Yes, it is bad. No the doctors can't always cure it" are good, short and simple ways to help her understand.
Explain as much as you can to her but leave out technical or difficult words. Make your sentences short and let her ask as many questions as she needs to. Let her come to you or another adult your family and ask questions or talk about the situation any time she feels the need. Children sometimes take time to think things through then discover they have lots of questions. If you let her have the option of talking to you anytime, she will be less anxious about what is happening.
Let her cry, get angry or otherwise express any emotion she needs. She will need to understand that when someone is sick and may die, any emotion is ok.
There is also several good books for your daughter. One is called Gentle Willow: A Story for Children About Dying by Joyce C. Mills and Cary Pillo. Another is Water Bugs and Dragonflies: Explaining Death to Young Children, A Coloring Book by Doris Stickney and Robyn Henderson Nordstrom. These are at Amazon.com or your local library may have them.
I hope this has helped you,