1. Motion Scare
motionscare.com
This is a simple Flash app that allows you to set up your computer to play a scary sound in response to webcam-detected motion. When your victim walks into view of the camera, the sound will blast through your speakers.
You can choose your desired sound and trigger sensitivity. You might scare yourself while playing with the sensitivity and sound settings, so keep your volume low at first.
2. iAlarm for Mac OS X
macupdate.com
If you are looking for installable software, you can install iAlarm on your Mac. It can trigger an alarm not only based on the webcam, but also from shaking of the internal accelerometer or mouse movements.
This software is very rich in features and can also capture a picture of the prank victim and send you an SMS when it triggers.
3. YawCam
yawcam.com
If you are a Windows user, YawCam can also be set up to play a sound in response to webcam-detected motion. This is also software primarily designed for security applications in mind, but can be set up to trigger a sound by going to the "Actions" tab and selecting "Play Sound".