Ah I had this happen to me more then once growing up. It was the burn that just crushed me. Luckily I realized It was fun to have the rotating friends...and then a few have stuck by me for the long haul...She will eventually have that someone who truly is stuck to her like glue. I did not get mine until 4th grade.....I am going to be a bridesmaid in her wedding two weeks from now:)
Best advice is make her feel special for the time being. There will be someone who takes old friends place soon enough.
For the time being go do some fun girl stuff with her....This is the time you can be her hero and just be mom.
As for her friend rejecting her.....Eventually she will see what she has done. There is no promise she will change her mind...but maybe there will is the chance at least for some mutual respect.
It's hard to see these things coming. and it is even harder to pin point why it happens. Maybe it was nothing your daughter did. Maybe it was something that changed in her friends life....It could just as easily be on the other kiddo's doing. Sadly your kiddo bare's the brunt of the pain from it.
Keep 'er chin up:)