Ray systems are bright streaks of ejected material that ring many impact craters on the Moon and other planetary bodies. In this video we show how ray systems form in impacts on a granular bed. The key to ray formation is the surface topography of the bed. For a smooth, evened-out surface, the ejecta is distributed uniformly around a crater to form a sheet-like ejecta blanket. In stark contrast, for an undulatory surface the ejecta gets shaped into a ray system. We ascertain that the number rays in a ray system ∝ D/λ, where D is the diameter of the ball and λ is the wavelength of the undulations. Further, we show that the rays originate from valleys that lie at a distance D/2 from the site of impact. Based on our findings we develop a novel model that one can use to estimate the size of an impactor for craters with ray systems.