In this paper we give several conditions implying the irreducibility of the algebraic curve P (x)−Q(y) = 0, where P, Q are rational functions. We also apply the results obtained to the functional equations P (f ) = Q(g) and P (f ) = cP (g), where c ∈ C. For example, we show that for a generic pair of rational functions P, Q the first equation has no non-constant solutions f, g meromorphic on C whenever (deg P − 1)(deg Q − 1) ≥ 2.