It would help to know which program.
Normally a scratch disk/volume is used when possible, even a striped array, for editing, erased between jobs. Not RAM though more RAM would lessen hitting the scratch partition.
Some programs use the boot drive as primary scratch if an alternate is not selected.
A good rule of thumb is to keep the system drive "lean and mean" with plenty of free space.
An outer partition of another hard drive, or one or more used solely for scratch.
Never ever let your boot drive get above 2/3rds or so full, you can get away with it but performance suffers; and if you hit 10% or less, or 10GB or less, watch out. You could lose the index to where all your files are.
Scratch disk volumes should be fast.
WD 640GB has been a favorite and winner and fast for ~$70 as system drive, scratch, or even media drive. $89-99 for a good 1TB drive. Excellent for media files, and still use 300GB outer partition for your scratch volume.
From Wikipedia on "Scratch space"
http://en.wikipedia.org/wiki/Scratch_space
Scratch space is space on the hard disk drive that is dedicated for only temporary storage. It cannot be used to permanently backup files. Scratch disks can be set to erase all data at regular intervals so that the disk space is left free for future use. The management of scratch disk space is typically dynamic, occurring when needed.
Scratch space is commonly used in graphic design programs, such as Adobe Photoshop. It is used when the program needs more memory, and the amount of available system RAM is insufficient. A common error in that program is "scratch disks full", which occurs when one has left the scratch disks configured to the default setting, being the boot drive. Many computer users gradually fill up their primary hard drive with Internet downloads, slowly reducing the amount of space the scratch disk may take up.
Partitioning off several gigabytes of hard drive and leaving that space empty will ensure a reliable scratch disks[weasel words]. Hard drive space, on a per-gigabyte basis, is far cheaper than RAM, though performs far slower. Even if on a separate physical drive (even a high-spindle drive (such as a 'WD Raptor') or an SSD) to the main operating system and software, a scratch disk cannot match RAM for speed. However, since 10,000 RPM hard drives or SSDs can be purchased with capacities of up to 300 GB or beyond (respectively) - whereas few motherboards can handle more than 32 GB of RAM -, for applications such as video editing, it is a reasonable solution.
[edit] Adobe Photoshop
To manually change the scratch disk in Adobe Photoshop click Edit > Preferences > Performance, then choose a different hard drive.