Do something like
local part = Instance.new("Part", game.Workspace)
part.CFrame = CFrame.new((pos1 + pos2) / 2, pos1)
part.Size = Vector3.new(0.5, 0.5, x)
where pos1 is the first position, pos2 is the second position, and x is the length of the line.