Using a dessert spoon, scrape out the black gills from the underside of the mushroom cap. Removing the gills reduces the amount of black juice the mushroom will exude.
Heat the oil in a medium nonstick skillet over medium heat. Add the mushroom, flat side down, and cook until the underside is browned, about 4 minutes. Turn the mushroom an cook until tender, about 2 minutes. Transfer to a plate and season with salt and pepper.
Wipe out the skillet with moist paper towels. Add the butter and melt over medium heat. Placed the mushroom cap on one slice of bread, spread with the pesto, and sprinkle with the cheese. Top with the remaining bread and place the sandwich in the skillet. Cook, turning once, until both sides of the sandwich are golden brown, about 5 minutes. Serve hot.