The following does not exactly answer your question, but you may find it interesting. It is the Riemann-Hurwitz formula for surfaces.
Let $\phi:S_1\to S_2$ be a finite morphism between smooth, projective surfaces (over an algebraically closed field of characteristic zero) of degree $n$, and let $B\subseteq S_2$ be the set of $y\in S_2$ such that $\phi^{-1}(y)$ does not contain $n$ points (i.e. $B$ is the ramification locus). Zariski's purity theorem states that $B$ is pure of dimension one; let $B_1,\dots,B_r$ be its irreducible components, and let $n_i$ be the degree of the morphism $\phi|_{\phi^{-1}(B_i)}:\phi^{-1}(B_i)\to B_i$. Then
$$\chi(S_1)=\chi(S_2)\deg \phi-\sum_{i=1}^r(n-n_i)\chi(B_i)+\sum_{y\in B}\left(|\phi^{-1}(y)|-n+\sum_{i=1}^r(n-n_i)m_i(y)\right)$$
where $m_i(y)$ denotes the number of local branches of $B_i$ at $y$. Here $\chi$ is the $\ell$-adic Euler characteristic of the surface ( topological Euler characteristic if $k=\mathbb{C}$), which can be translated into a Chern class if you prefer.
The proof is B. Iversen, 'Numerical invariants and multiple planes', Amer. J. Math. 92 (1970), 968-996. When $k=\mathbb{C}$, you can prove it by thinking of the topological Euler characteristic as a measure on constructible sets (e.g. O. Ya. Viro, Some integral calculus based on Euler characteristic); then the formula is equivalent to Fubini's theorem ($\int\int dxdy=\int\int dydx$) for the graph of $\phi$.
Let me expand jvp's answer, giving a picture of the situation in the case of a $general$ flat triple cover $f \colon X \to Y$.
Let $R \subset Y$ be the ramification divisor and $B \subset Y$ the branch divisor, that is $B = f(R)$. Then $R$, $B$ are both reduced and irreducible, and $B$ has only a finite number of ordinary cusps $q_1, \ldots, q_t$ as singularities. These cusps are exactly the points over which $f$ is $totally$ $ramified$. Moreover $R$ is isomorphic to the normalization of $B$, in particular it is $smooth$.
One has the equality of divisors
$f^*(B)=2R + R'$,
where $R'$ is another irreducible curve, isomorphic to $R$, which meets $R$ in a finite number of points $p_1, \ldots, p_t$. Notice that $R'$ is $not$ a component of the ramification locus, since the latter consists of $R$ alone.
Moreover
- $R$ and $R'$ are tangent at $p_1, \ldots, p_t$;
- $p_1, \ldots ,p_t$ are the preimages of the cusps $q_1, \ldots, q_t$.
Summing up, in this case your $S$ is the set whose elements are the points $p_1, \ldots ,p_t$. They correspond to the points where the ramification divisor $R$ meets the curve $R'=f^*(B) \setminus R$. In other words, they come from the singular points of the branch divisor $B$ (whereas the ramification divisor $R$ is smooth).
This is easy to see; a good reference is Miranda's paper "Triple covers in algebraic geometry".
Anyway, the crucial fact here is that a general triple cover is not a Galois cover, so over the branch locus $B$ there are both points where $f$ is ramified (the curve $R$) and points where it is not (the curve $R'$).
If you consider instead any Galois cover, say with group $G$, then every preimage of a branch point is a ramification point (and the stabilizers of points lying on the same fibre are conjugated in $G$). In this case there are formulae relating the ramification number of a point on $X$ with the ramification numbers of the components of the ramification locus passing through it.
See Pardini's paper "Abelian covers of algebraic varieties" for more details.
Best Answer
degree of the canonical divisor doesn't make any sense as already pointed out by Mohammed.
On the other hand, by "purity of the branch locus", the branch locus, as well as the ramification locus of $f$ is a sum of irreducible divisors. Denote by $R_i$ the irreducible components of the ramification locus. Then, the local rings of the generic points of the $R_i$ are DVR's, and one can associate ramification indices $e_i$ to them (as explained in Hartshorne's book). Local computations show that $$ \omega_X \cong f^*\omega_Y\otimes{\cal O}_Y(\sum_i (e_i-1)R_i) $$ In fact, one checks this outside the intersections of the $R_i$, where these local computations are easy. This gives the desired isomorphism outside codimension $2$, and by reflexivity, the desired isomorphism holds everywhere.