Perpendicular at the Vertex of a Ray
If the point where you want to construct a perpendicular is the vertex of a ray or endpoint of a segment, then you simply use the straight-edge to extend the ray or segment so the point is no longer the endpoint and do as before: make the point the midpoint of some segment and construct the perpendicular bisector of that segment.
Given: Segment AB
Construct a line perpendicular to AB through point A.
Solution:
Place the straight-edge along AB (points A and B determine only one line) and extend the segment to any convenient length to point C so that A is between C and B:
Then place the point of the compass at A and pencil at C to measure the distance AC, and mark off point D between A and B using an arc of this radius:
Finally, construct the perpendicular bisector of CD:
Another method is to make use of the fact that an angle inscribed in a semicircle is a right angle:
Here is an animation of that method.