Coprime elements in finite rings 
Let $R$ be a finite commutative ring. Consider elements $a,b \in R$ such that $Ra+Rb=R$.  A paper I'm reading asserts that there exists some $x,y \in R$ such that $x(a+yb) = 1$.  

Of course, it is clear that we can find some $x,y \in R$ such that $xa+yb=1$, but it is not clear that we can get the above stronger statement. It is equivalent to saying that there exists some $y \in R$ such that $a+yb$ is a unit.
Can anyone help me?
 A: This is true more generally in any (commutative unitary)  semi-local ring (ring having only finitely many maximal ideals), and is a consequence of the following special form of Prime Avoidance Lemma :

Let $p_1, \dots, p_n$ be prime ideals, let $I$ be an ideal and $a\in R$ such that $aR+I\not\subseteq \cup_{i\le n} p_i$, then there exists $\beta\in I$ such that $a+\beta\notin \cup_{1\le i\le n} p_i$. 

Now if $aR+bR=R$, then apply the above result to $I=bR$ and $p_1,\dots, p_n$ the maximal ideals of $R$. Note that the union of the $p_i$ is exactly the set of the non-invertible elements of $R$. 
A proof of the Prime Avoidance Lemma can be found in Kaplansky, Commutative Rings, p. 90, Thm 124, or Bruns & Herzog, Cohen-Macaulay Rings, Lemma 1.2.2.
Note that for finite rings, there is probably a simpler proof.

Edit: second proof. How can I forget my favorite CRT ?! 
Let $R$ be semi-local (this includes of course the finite ring: if $m_1, \dots, m_n$ are pairwise distinct maximal ideals, then $m_1, m_1\cap m_2, \dots, m_1\cap ...\cap m_n$ is a strictly decreasing sequence of subgroups, hence $n$ is bounded by the cardinality of $R$). 
Let $m_1,\dots, m_n$ be the maximal ideals of $R$. For each $i\le n$, there exists $c_i\in R$ such that 
$$a+bc_i\not\equiv 0 \mod m_i.$$ 
This is clear if $b\not\equiv 0 \mod m_i$, otherwise, $b\in m_i$, thus $a\notin m_i$ by $aR+bR=R$, then take any $c_i\in R$. Now by CRT, there exists $c\in R$ such that $c\equiv c_i \mod m_i$ for all $i\le n$. Therefore $a+bc\notin m_i$ for all $i\le n$. This implies that $a+bc$ is a unit.
