Spectrum leasing via cooperation refers to the possibility of primary users to lease a portion of their spectral resources to secondary users in exchange for cooperation. This paper proposes a novel application of this concept, where in the presence of an eavesdropper, the secondary cooperation aims at improving the secrecy of the primary network. It does this by creating more interference to the eavesdropper than to the primary receiver. To generate the interference in a positive way, this paper studies an optimal design of a beamformer at the secondary transmitter with multiple antennas. The design maximizes the secrecy rate of the primary network while satisfying a required rate for the secondary network. Moreover, we investigate two scenarios that are contingent on how the eavesdropper operates: 1) The eavesdropper treats the interference by the secondary transmission as additive noise [single-user decoding (SD)]; and 2) the eavesdropper tries to decode and remove the secondary signal [joint decoding (JD)]. Numerical results confirm that, for a wide range of required secondary-rate constraints, the proposed spectrum-leasing strategy increases the secrecy rate of the primary network.