Diagnosis
That's almost certainly something jammed in the drain pump impeller. A piece of glass, a pit, or a small bone gets sucked in and rattles around.
How to Fix It
First, check the filter assembly in the bottom of the tub. Remove the lower spray arm and lift out the cylindrical and flat filters. Clean them thoroughly under running water. Often, the culprit is right there. If not, you'll need to access the drain pump housing, which is behind the lower kick plate. Disconnect power first, then check for obstructions.
If That Didn't Work
The noise could be from the drain pump motor itself failing. If the impeller spins freely with no obstruction, the pump's bearings might be shot, requiring a full pump replacement.
Heads Up
Never run the dishwasher if you hear this noise. A stuck object can burn out the pump motor. Always investigate the grinding sound immediately.