Was it simply a case of being able to see it and thrust in the general direction, or was there something more sophisticated at work? Was the CSM itself in a selenostationary orbit, or was it moving with respect to the lunar surface, thus making it even more difficult?
The process was a great deal more sophisticated than pointing and thrusting, and the CSM was cooking along at over 1600 m/s, circling the moon every 2 hours.
Mission control, however, had fairly precise tracking of the positions of both the CSM and the landing site, and they computed the correct time of launch to begin the rendezvous using powerful Earth-side computers. The CSM was tracked using the Unified S-Band system. For Apollo 11, the LM's position was determined by using the LM's rendezvous radar to determine the direction and distance to the CSM (see commentary at 121:00:34) as it passed overhead, but for the later Apollo missions, I believe there was better tracking of the LM down to the surface and landing sites could be pinpointed by comparing observations from the surface against Lunar Orbiter imagery.
The LM ascent stage launched initially into a 18km x 87km elliptical orbit somewhat behind the CSM, which was orbiting at 105km x 116km (a higher, slower orbit). At the high point of that elliptical orbit, about an hour after liftoff, the LM circularized its orbit using its RCS thrusters; this is called the "Coelliptic Sequence Initiation" burn.
I believe from this point on, Eagle could detect Columbia on rendezvous radar.
Two and a half hours later, with the LM about 72km from the CSM and approaching at 34 m/s, they did another RCS burn called "Terminal Phase Initiation" to intercept the CSM. 10 minutes after that, Armstrong was able to see the CSM. Until the ships were very close together, the maneuvering was all done under computer control using radar data; once they were close together and velocity-matched, they manually flew the approach.
All the maneuvering of the approach was done by the LM, but the CSM was at each point prepared to make the reciprocal maneuver, such that if the LM's crew, computers, or RCS failed, the CSM would have taken over as the active participant in the rendezvous.
Since the rendezvous approach plan was fairly leisurely, and the RCS thrusters capable of quite precise small adjustments, any small deviation in the initial ascent (due to errors in the estimated positions of the craft, the timing of the launch, or variation in the performance of the ascent engine) would be easily taken care of in the following maneuvers. This incremental approach is the key to any orbital rendezvous, whether in Earth orbit or lunar.