Generally when a file you download is corrupted, opening it results in an error or just the inability to read it properly; however, in rare cases corruption in executable files such as installers and programs can result in crashes and other unwanted behavior.
Periodically files you download from online services such as the Mac App Store or from Web sites may become corrupted and result in a verification error when you try to open them. If this happens, then it is recommended you avoid using the file, since while usually it will just not read properly there are instances where executable files can still run but not function properly and either crash or cause further corruption or unwanted behavior.
While the idea of corruption sounds like a malicious act, it is not necessarily so. Anytime a file is accessed there is chance that it can get corrupted, either in its storage location on a remote or local disk, or during its transfer if the connection gets interrupted.
To help prevent this, many services such as the Mac App Store will generate a key called a checksum that is a method of checking the organization of all the bits and bytes in a file to ensure they are in the proper order. The checksumming routine is performed on the original file and then distributed with it, and after you have downloaded the file the checksum is run again. If the generated checksum keys do not match, then it is safe to assume the file has been changed from its original version.
There are numerous ways that files can get modified or corrupted, so if you run into an error stating a checksum cannot be verified then while one possibility is it has been purposefully tampered with, this generally is not the case. Often slight modifications to a file can happen by the server that contains it, be it even as small as changing aspects of the file's metadata or updating the file to a new version without updating its checksum. In addition to server-side modifications, files can also be corrupted in the transfer to your system, such as from interruptions in the download process.
If file corruption happens and you see an error claiming the system could not verify the file or that its checksum does not match, then the best thing to do is first delete the file and try redownloading it. If you are using a download service like the Mac App Store, then quit the program and delete the downloaded file. This will ensure that when you relaunch the program you will establish a new, fresh connection with the server, and better avoid accessing cached download data that could contain corruptions.
In addition to redownloading the file, try disabling any file-scanning utilities such as antivirus programs. While these programs should not alter any files, they can be set up to actively scan them during the download or after the download and thereby have a chance of altering them if there is a bug in the scanner program.
As a final option, sometimes if you are continually having problems with the same file then try waiting and redownloading it at another time (hours or even days later), to allow any server-side problems to be resolved before trying again. Alternatively, you can also try downloading the file using another computer and then copy it to your system. For instance, a number of people who downloaded OS X Lion through the Mac App Store ran into file verification problems on some systems. In this case, these people could easily copy the valid installer from another system to the one with the troubles, and be able to install the operating system just fine, avoiding the need to repeatedly download the file.