Bring a large pot of water to a boil and gently place ears of corn into the boiling water. Reduce heat to low and simmer until corn is very tender, 20 to 25 minutes.
Remove an ear of corn with tongs and spread about 1 tablespoon of mayonnaise all over the kernels. Squeeze about 1 tablespoon of margarine over the ear of corn in a zig-zag line, turning the ear as you squeeze. Generously sprinkle Parmesan cheese over the ear and dust with chili powder. Repeat with remaining ears of corn.