X-ray lasing on five Ne-like lines has been demonstrated using thick, laser-irradiated germanium targets, up to 2.2 cm in length. The scaling of gain with the plasma length and the laser angular distribution have been measured. The experiment has been modeled using codes which simulate the hydrodynamics of the target expansion in two dimensions and the propagation of the X-ray laser beam in three dimensions. Code calculations which successfully replicate the experimental results show that for each ray trajectory, only a limited plasma length contributes to the total gain-length product, so that at long plasma lengths the gain is limited by refraction. The major contribution to the observed gain comes from rays which are refracted into and out of high-density target regions, and sample the highest local gain near their turning points. The use of a target with a curved surface would enable near-exponential gain to be maintained over longer plasmas without being limited by refraction.