Preheat a grill to medium-high. Arrange the corn on the grate and grill, turning occasionally, until the kernels are golden-brown and softened, 8 to 10 minutes. Once cool enough to handle, remove the corn kernels from the cobs; discard the cobs. (You should have about 5 cups kernels.) Lower the grill temperature to medium.
Heat a large cast-iron skillet over the grate. Add the butter to melt, then whisk in the flour until combined and foaming, about 2 minutes. Gradually whisk in the milk and cream cheese and cook, whisking constantly, until smooth and thick, 2 to 3 minutes. Stir in the corn kernels; season with salt, black pepper and the cayenne, if using, and cook until heated through, about 1 minute.