Current models describe male-specific fruitless (fruM) as a genetic 'switch' regulating sexual behavior in Drosophila melanogaster, and they postulate that female (F) and male (M) doublesex (dsx) products control body sexual morphology. In contradiction to this simple model, we show that dsx, as well as fruM and non-sex-specific retained (retn), affect both male and female sexual behaviors. In females, both retn and dsxF contribute to female receptivity, and both genes act to repress male-like courtship activity in the presence or absence of fruM. In males, consistent with the opposing functions of dsxM and dsxF, dsxM acts as a positive factor for male courtship. retn also acts counter to fruM in the development of the male-specific muscle of Lawrence. Molecularly, retn seems to regulate sexual behavior via a previously described complex that represses zerknullt. Thus, we show that fru and dsx together act as a 'switch' system regulating behavior in the context of other developmental genes, such as retn.