Epilepsy is one of the most common neurological disorders affecting about 1% of the world population. For patients with focal seizures that cannot be treated with antiepileptic drugs, the common treatment is a surgical procedure for removal of the seizure onset zone (SOZ). In this work we introduce an algorithm for automatic localization of the seizure onset zone (SOZ) in epileptic patients based on electrocorticography (ECoG) recordings. The proposed algorithm builds upon the hypothesis that the abnormal excessive (or synchronous) neuronal activity in the brain leading to seizures starts in the SOZ and then spreads to other areas in the brain. Thus, when this abnormal activity starts, signals recorded at electrodes close to the SOZ should have a relatively large causal influence on the rest of the recorded signals. The SOZ localization is executed in two steps. First, the algorithm represents the set of electrodes using a directed graph in which nodes correspond to recording electrodes and the edges weights quantify the pair-wise causal influence between the recorded signals. Then, the algorithm infers the SOZ from the estimated graph using a variant of the PageRank algorithm followed by a novel post-processing phase. Inference results for 19 patients show a close match between the SOZ inferred by the proposed approach and the SOZ estimated by expert neurologists (success rate of 17 out of 19).