There are some (and I am one of them) who believe that grammar cannot be taught except in the context of actual writing. You can teach how to write an essay or fiction. I've got author friends who have the technique down to a science of step one, step two, step three.
When you are correcting your child's writing, just point out the error and make them figure out what is wrong. Take the opportunity to explain the rules for that situation. Then give them a few examples to reinforce the lesson.
If you teach your kids to read with phonics and teach them the rules of spelling along with that (the long 'a' sound in the middle of a word is often spelled 'ai' whereas at the end of a word it is almost always "ay") they'll be much better spellers than my kids who got whole language in the public schools.
Here's what we do for language.