In The Martian, journeys to Mars are made possible through a large spacecraft known as the Hermes. Unlike the Apollo program, where each trip to the Moon required a separate spacecraft, the fictional Ares program uses the Hermes as a taxi to between Earth and Mars. Individual missions dock with the Hermes, but the Hermes simply makes the rounds between Earth and Mars over and over. While the Hermes is a work of fiction, it’s based in well established science.
The first ideas a spacecraft traveling between Earth and Mars are nearly a century old. In 1925 Walter Hohmann proposed an elliptical orbit between the two worlds. The Hohmann transfer orbit, as it came to be known, relies on Earth and Mars to be in the right positions relative to each other so that a spacecraft in a Hohmann orbit. This occurs about every 26 months, and a low delta-v trajectory. While it has its advantages, the one big disadvantage is that each Hohmann orbit has a different orientation each time. Another problem is that the orbits of Earth and Mars are not quite in the same plane, so things aren’t quite as simple as Hohmann proposed.
To have a large spacecraft that passes Earth and Mars with each orbit, you need some kind of thrust to adjust your orbit. In principle, chemical rockets could do the job, but they aren’t well suited for it. Chemical rockets are great for producing a large thrust in a short time, but a craft like the Hermes would need gradual thrust over longer periods. This can be done with ion drives, which accelerate charged particles at high speeds. In the novel, ion drives accelerate the Hermes at a constant 2 mm/s2, which is enough to continually adjust the orbit to match Earth and Mars. While we don’t yet have drives powerful enough for a craft like Hermes, ion drives are being used in missions such as the Dawn spacecraft currently at Ceres.
The only real disadvantage of ion drives is calculating their trajectories. If a spacecraft is continuously accelerating, its trajectory has to be determined computationally. This posed a real challenge for Andy Weir as he was writing the book. To get realistic trajectories for the Hermes he had to write a program to calculate them, and fiddle with parameters until he got a set of trajectories that worked. You can see the resulting trajectories here.