In a saucepan bring water to boiling. Slowly add grits, stirring constantly. Gradually stir about 1/2 cup of the hot mixture into the egg. Return egg mixture to saucepan and stir to combine. Remove saucepan from heat. Stir cheese and margarine into grits until melted.
Spoon grits into a 1-quart casserole. Bake in a 325 degree F oven for 25 to 30 minutes or until a knife inserted near the center comes out clean. Let stand for 5 minutes before serving.