  We generalize to sets with cardinality more than $p$ a theorem of R\'edei and
Sz\H{o}nyi on the number of directions determined by a subset $U$ of the finite
plane $\mathbb F_p^2$. A $U$-rich line is a line that meets $U$ in at least
$\#U/p+1$ points, while a $U$-poor line is one that meets $U$ in at most
$\#U/p-1$ points. The slopes of the $U$-rich and $U$-poor lines are called
$U$-special directions. We show that either $U$ is contained in the union of
$n=\lceil\#U/p\rceil$ lines, or it determines `many' $U$-special directions.
The core of our proof is a version of the polynomial method in which we study
iterated partial derivatives of the R\'edei polynomial to take into account the
`multiplicity' of the directions determined by $U$.
