I have to disagree with cwilbur.
Certainly call a vet and find out what to do, then do it to the best of your abilities.
But you also need to call the owner(s) of this cat and apprise them of this discovery, and what steps you plan to take. Ask them how they want the kittens dispersed. It is likely the kittens may not be ready to leave their mother before your friends get their apartment, in which case it will their decision and responsibility on how to disperse the kittens.
However, because you are not the owner of this cat, you do not have the right to get her spayed. Whether her pregnancy was accidental or intentional, her fertility is the responsibility, and the right, of your friends to address. They will not appreciate it if you have her spayed without their knowledge or consent. That could not only kill your friendship with them, you may be left holding the bag – cat and kittens to boot, not to mention the bill.
So, above all, call them. Discuss this with them. You may want to get their consent in writing, just to cover your butt if they change their minds later on. This is a situation fraught with potential unpleasantness. Walk very carefully here.