How do I calculate a line segment that is a certain number of degrees from another line segment?

I have a line segment that is at an arbitrary angle in 3D space. I want to (in code) draw another line that shares an end point with the first line and has an angle of X degrees between them. The second line will partially overlap the first in the XZ plane.