Try to sympathize but do not repeatedly say you are sorry. This is someone a persno who has lost someone dear to them hear a lot. Also keep it simple and show your support for that person.
Be sincere. Your friend will know if it's not sincere. Mention things you liked about her daughter and what made her special and unique. Tell a good memorable story about her. Don't say to take comfort in her other children ~ the child she lost can never be replaced!