Draw your line using the pen tool. Then while you have one of the points selected switch to the shape editor tool. Change the value in the box with an "A" next to it (Angle) to either 0 for horizontal or 90 for vertical.