We are travelling from 16-19 June and one of us is a Ukrainian citizen, whose Ukrainian passport expires on 14 September of the same year (2015). She also has a Spanish Student Card and Residence Card that doesn't expire until Sept 2016. Does she need a visa? Or to renew her passport before we travel?
Your friend does not need a visa to enter Switzerland, thanks to her Spanish residence card. I am not even sure she could get one and it would not help the passport issue.
If crossing an external border, then the passport expiration date could be a problem. The Schengen Borders Code now requires from third-country nationals that
(a) they are in possession of a valid travel document entitling the holder to cross the border satisfying the following criteria:
(i) its validity shall extend at least three months after the intended date of departure from the territory of the Member States. In a justified case of emergency, this obligation may be waived;
(ii) it shall have been issued within the previous 10 years;
But the same article further provides that
third-country nationals who do not fulfil all the conditions laid down in paragraph 1 but who hold a residence permit or a long-stay visa shall be authorised to enter the territory of the other Member States for transit purposes so that they may reach the territory of the Member State which issued the residence permit or the long-stay visa.
So in principle, a passport valid until at least September 19th should be required to cross an external border but that requirement can be waived and residence permit holders should still be at least authorised to return to their country of residence (i.e. not detained and removed). So it's not a very firm requirement and I am guessing border guards might therefore turn a blind eye for a couple of days.
For internal borders (e.g. travelling directly from Spain to Switzerland without leaving the Schengen area), I don't see how the passport's validity can be an issue. Most of the time, you shouldn't have to go through a formal passport check and even if there is one, it would not be a “thorough” external border check so the rules I just mentioned do not apply. And your student has both a valid ID and a valid title to be in the Schengen area.
Still, if at all possible, renewing her passport would seem like a good idea.