Position a rack in the middle of the oven and preheat to 425°F Butter a shallow 1 1/2 to 2 quart baking dish.
In a medium saucepan over moderate heat, melt the butter. Whisk in the flour to make a roux, whisking constantly for 1 minute. Whisk in the half and half, salt, and cayenne, then reduce heat and simmer, stirring occasionally, until thickened, about 3 minutes. Stir in the corn and 1/4 cup of the cheese.
Put corn in a prepared casserole, top with remaining parmesan cheese and bake until browned and bubbly, about 15 minutes.