If you can, try making a nice, deep trench. Make it deep enough, and entire horses will tumble into it. Half the enemy's charge could well end up suffocating beneath the bodies of their comrades who fell in atop them; a grisly prospect, but very effective as a morale blow to the survivors.
A deep trench can be easily seen by the front ranks unless concealed carefully, true. That is not the same as being able to stop before hitting it when you have hundreds or thousands of other horsemen behind you whose view is obstructed by...well, by the horses and men in front of them. You simply cannot arrest a charge instantly even on foot; on horseback, you'll need considerably more space and time to do that, and if this trap is executed properly they won't have that time before they hit the trench. Even if they manage to stop short of the trench, that gives your archers (which you presumably have, as any smart army would) a golden opportunity to unleash their fire at close range and shred the cavalry.
Given that this is being done spontaneously via magic, you don't really need to worry about preparation time. All that matters is the skill and power of your magic-wielders, which is defined by you the author. If they have the capability, they should excavate this trench while leaving a thin layer at ground level: enough to look like it's solid ground, but not enough to hold the weight of a horse. This gives you effectively perfect concealment, making sure that they don't catch on and pull back until it's too late. There is the problem of where all that dirt will go; shunt it off to the sides of your forces, perhaps, to raise walls cutting off any flanking strike against your forces that might be attempted, which has the bonus of funnelling the enemy cavalry more completely into your trap.