Photoionized and Photodissociated Regions around Main-Sequence Stars