There is an important quote in the Brihat Parashara Hora Shastra,ch. 36., that explains how Rahu and Ketu can give a raja yoga:

If the shadowy planets Rahu and Ketu are situated in an angle or a trine, are in a conjunction with or are aspected by the angular lord or the trinal lord, even then they are raja yoga karakas (indicators of raja yoga). - translated by Girish Chand Sharma

The following example chart shows how Ketu becomes a raja yoga karaka by being located in a trinal house and aspected by two angular lords, the Moon and Saturn, rulers of the 10th and 4th houses respectively. 

Vedic astrology chart