compare James and Pynchon or Jacobs and Whitehead who take different approaches within the same genre. Or you might compare the styles or aims of authors who seem to be working in much different genres, comparing a realist-era writer to a postmodernist. You could compare two writers by detailing an important relationship between them, a relationship such as knowability or unknowability. Or you could compare literary techniques or political aims or themes and so on. How do the two authors deal with gender or race or cultural issues? How does each work appeal to the emotions or our sense of reality or whatever. In short, you may compare realism to postmodernism or compare two different approaches to realism or postmodernism.
There are many different ways to approach a comparative analysis, though I think it is key to figure out what your grounds for comparison are (why did you pick these two texts rather some other texts?) and your reasons for comparing (Why bother, aside from me telling you to do so? Or, what is interesting, significant, or productive about comparing these two texts? What do we learn about these texts that we might not realize by just reading them separately as opposed to reading and comparing them to each other?).