Motivated by recent experiments on beta-Li2IrO3, we study the phase diagram of the Heisenberg-Kitaev model on a three-dimensional lattice of tricoordinated Ir4+, dubbed the hyperhoneycomb lattice. The lattice geometry of this material, along with Ir4+ ions carrying J(eff) = 1/2 moments, suggests that the Heisenberg-Kitaev model may effectively capture the low-energy spin-physics of the system in the strong-coupling limit. Using a combination of semiclassical analysis, exact solution, and slave-fermion mean-field theory, we find, in addition to the spin liquid, four different magnetically ordered phases depending on the parameter regime. All four magnetic phases-the Neel, the polarized ferromagnet, the skew-stripy, and the skew-zig-zag-have collinear spin ordering. The three-dimensional Z(2) spin liquid, which extends over an extended parameter regime around the exactly solvable Kitaev point, has a gapless Majorana mode with a deformed Fermi circle (codimensions, d(c) = 2). We discuss the effect of the magnetic field and finite temperature on different phases that may be relevant for future experiments.