Consider a unit vector in the direction of a given line. In two dimensions, it is [itex]<cos(\theta), sin(\theta)>[/itex] where [itex]\theta[/itex] is the angle the line makes with the x-axis. (And the slope is [itex]tan(\theta)[/itex].)
A unit vector in three dimensions is given by [itex]<cos(\alpha), cos(\beta), cos(\gamma)>[/itex] (the "direction cosines" of the direction) where [itex]\alpha[/itex] is the angle the line makes with the x axis, [itex]\beta[/itex] is the angle the line makes with the y axis, and [itex]\gamma[/itex] is the angle the line makes with the z axis. Because this is a unit vector, these must satisfy [itex]cos^2(\alpha)+ cos^2(\beta)+ cos^2(\gamma)= 1[/itex] but this still depends upon two angles so we cannot give a single number, slope or other, that determines the direction of the line.
(Note that in two dimensions we can take [itex]\gamma= 0[/itex] so [itex]cos^2(\alpha)+ cos^2(\beta)= 1[/itex] which means that [itex]cos(\beta)= sin(\alpha)[/itex].)