Freeform optics have been found in a variety of beam shaping designs. However, they are typically used to form prescribed illumination patterns on a planar surface. In this paper, we will demonstrate a ray mapping based method to design smooth freeform lenses to form complicated illumination distributions on curved surfaces. The ray mapping between the source and target is established by solving an optimal mass transportation problem which is governed by the Monge-Ampére partial differential equation. Then, the freeform lens is constructed by a geometric method based on the optimal ray mapping. Finally, the performance of the lens is verified by Monte Carlo ray tracing simulation in Zemax OpticStudio software. To show the effectiveness of the proposed method, several freeform lenses are designed as examples for a collimated light source to generate different illumination patterns on different curved surfaces. A freeform lens is also fabricated and experimented.