How can I check it if a line3D/ or ray is intersecting a sphere?
The real time rendering web-site is good source for different intersection algorithms (including ray/sphere intersection):
The problem logically reduces to finding the shortest distance between the ray (line) and the sphere centre. If that distance is shorter than the sphere radius, there is an intersection.
Of course, there's a formula for line-point distance.