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.
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.