There really isn't a right thing to say - just be there for them. Offer your support and ask what you can do for them.
Things not to say include "it will be OK", "you will be fine" or "my (insert name) had cancer 10 years ago and she is OK." This is not giving encouragement but down playing their genuine concerns and fears.
My close friends never said the wrong thing, mainly because I knew they meant well and were struggling how to respond with such news. I am sure your friends will be the same.
You sound like a good friend, hopefully they will get good news and you can all go out to celebrate.