If you don’t have an oven-proof pan, just transfer the beans to an oven dish, then top with the cheese and bake.