In this paper, we introduce a new concept called generalized ring signcryption (GRSC), which can achieve ring signature and ring signcryption functions with only one key pair and one algorithm. It is very useful for a system which has a large number of users, or has limited storage space, or whose function requirements may be changed later. We give a formal definition and a security model of GRSC and propose a concrete scheme based on bilinear pairings. In the random oracle model, the scheme's confidentiality can be proved under the GBDH assumption, and its unforgeability can be proved under GDH' assumption, and what is more, this scheme also allows unconditional anonymity. Compared with other identity-based ring signcryption schemes that use bilinear pairings as well, our scheme is a highly efficient one.