There are lot of algorithms to recognize faces. All basically work on same principle. You extract the key features of the face (From training image) using some technique and store it in a database. Then use the same technique to extract feature from the given image and compare the obtained features with the database. The best match is the recognized face.
To detect features algorithms like blob analysis, edge detection and corner detection or SIFT (Scale Invariant Feature Transform) or segmentation based on colour and gradient. Of course, these are not exactly used as it is, they are modifies and optimized and then used.