How to use raycasting to fix weird issue with glove ability

How would I use raycasting to fix an issue where when I use the corrupt spikes ability (Based off of the earth spikes from the earth spikes topic / All credit goes to him) I am able to put the spikes in the air, but what I am looking for is how to make it so the spikes are always on the terrain, even if the some terrain has a different height than the other terrain.

Here is a little video provided to show the corrupt earth spikes ability: