Often one of the members of the crew is a qualified doctor and even when this is not the case all astronauts had some level of medical training.
Astronauts are highly trained individuals who have had very strict medical tests to make sure they are fit enough for space. This makes it less likely for astronauts to get ill in space but if they do there is help on hand from their crewmates. Also, all the medical supplies they may need are on-board the International Space Station (ISS).
All the astronauts have medical training, dentist training and even work during their astronaut training in a hospital emergency room. So they can treat each other using the medical equipment on board ISS. Plus they have telemedicine links to specialists on ground and can do ultrasounds etc live with a specialist. And of course their personal space Doctor who they talk to in a private conference every week knows everything about them in great detail and they would come to mission control to help the astronaut over private videoconference too.