Light usually propagates inside transparent materials in well known ways. However, recent research has examined the possibility of modifying the way the light travels by taking a normal transparent dielectric and inserting tiny metallic inclusions of various shapes and arrangements. As light passes through these structures, oscillating electric currents are set up that generate electromagnetic field moments; these can lead to dramatic effects on the light propagation, such as negative refraction. Possible applications include lenses that break traditional diffraction limits and `invisibility cloaks' (refs 5, 6). Significantly less research has focused on the potential of such structures for slowing, trapping and releasing light signals. Here we demonstrate theoretically that an axially varying heterostructure with a metamaterial core of negative refractive index can be used to efficiently and coherently bring light to a complete standstill. In contrast to previous approaches for decelerating and storing light, the present scheme simultaneously allows for high in-coupling efficiencies and broadband, room-temperature operation. Surprisingly, our analysis reveals a critical point at which the effective thickness of the waveguide is reduced to zero, preventing the light wave from propagating further. At this point, the light ray is permanently trapped, its trajectory forming a double light-cone that we call an `optical clepsydra'. Each frequency component of the wave packet is stopped at a different guide thickness, leading to the spatial separation of its spectrum and the formation of a `trapped rainbow'. Our results bridge the gap between two important contemporary realms of science-metamaterials and slow light. Combined investigations may lead to applications in optical data processing and storage or the realization of quantum optical memories.