How can DNA microarrays be used to determine which genes

How can DNA microarrays be used to determine which genes of a bacterial pathogen are expressed both inside and outside of a host cell?