We prove that CR functions defined in a wedge inside a CR manifold extend to be CR (or holomorphic) in the directions given by the higher order generalization of the Levi form taken at complex tangent vectors satisfying the so-called rays condition. This generalizes extension results by Boggess-Polking [7], Baouendi-Treves [3], Fornaess-Rea [10] and the second and the third authors [18] and puts them into a unified frame.