In some courses, if you defeat a certain time in the Time Trials, you'll be able to race against a hidden ghost on that track. Here are the 3 courses that have ghosts:
Get under 1:51:00 to race against Luigi!
Get under 1:30:00 to race against Mario!
Get under 2:40:00 to race against Peach!