A line in space has a direction. The direction cosines of a line are the cosines of the angles $\alpha,\beta,\gamma$ that it makes with the positive $x$, $y$, $z$ axes, written $l=\cos\alpha,\ m=\cos\beta,\ n=\cos\gamma$.
The fundamental identity
Direction cosines always satisfy
$$l^2+m^2+n^2=1.$$
Direction ratios
Any three numbers $a,b,c$ proportional to $l,m,n$ are called direction ratios. They are not unique (any non-zero multiple works). To convert ratios to cosines, divide by the magnitude:
$$l=\frac{a}{\sqrt{a^2+b^2+c^2}},\quad m=\frac{b}{\sqrt{a^2+b^2+c^2}},\quad n=\frac{c}{\sqrt{a^2+b^2+c^2}}.$$
Line through two points
The direction ratios of the line through $A(x_1,y_1,z_1)$ and $B(x_2,y_2,z_2)$ are $x_2-x_1,\ y_2-y_1,\ z_2-z_1$.