The objective of the present paper is to derive a set of analytical equations that describe a swing-by maneuver realized in a system of primaries that are in elliptical orbits. The goal is to calculate the variations of energy, velocity and angular momentum as a function of the usual basic parameters that describe the swing-by maneuver, as done before for the case of circular orbits. In elliptical orbits the velocity of the secondary body is no longer constant, as in the circular case, but it varies with the position of the secondary body in its orbit. As a consequence, the variations of energy, velocity and angular momentum become functions of the magnitude and the angle between the velocity vector of the secondary body and the line connecting the primaries. The "patched-conics" approach is used to obtain these equations. The configurations that result in maximum gains and losses of energy for the spacecraft are shown next, and a comparison between the results obtained using the analytical equations and numerical simulations are made to validate the method developed here.