Lines on projective varieties and applications