In this paper we consider two-way relaying with a MIMO amplify and forward (AF) relay. Assuming that the terminals have perfect channel knowledge, the bidirectional two-way relaying channel is decoupled into two parallel effective single-user channels by subtracting the self-interference at the terminals. We derive the relay amplification matrix which maximizes the (weighted) sum rate in the case where the terminals have a single antenna. By algebraic manipulation of the rate expressions we can rewrite the optimization problem as a generalized eigenvalue expression which depends on two real-valued parameters. The optimum is then found by a 2-D exhaustive search, which can be efficiently implemented via the bisection method. The resulting method is called RAGES (RAte-maximization via Generalized Eigenvectors for Single-antenna terminals). Moreover, both parameters have a physical interpretation which allows to find sub-optimal heuristics to reduce the complexity of the search even further. As shown in simulations, a corresponding suboptimal 1-D search is very close to the optimum sum rate.