The following are CSV data files for lists of stocks in various U.S. markets that I have collected for some of my research projects (as of January 2008). It is not trivial to find all of this information for free, so I am listing them here in case somebody else finds them useful. Please note that my research is focused on penny stocks, so the major market listings may be inaccurate or incomplete.
Update 2017-01-23: The source code for the scripts that I used to collect this data is available here. Be aware that they are old and may not work anymore.
Update 2010-12-31: I have posted three years worth of intraday penny stock data for download on this page
Tab-Delimited, File Format: <COMPANY NAME, SYMBOL>
I am also posting free interday historical data that I collected from Internet sources in 2007. The data ranges from 1970 to 2006 (depending on how old the company is) and only includes basic information about the price and volume. For certain stocks, there is missing data in some of the tuples (especially prior to 1972) and some dates may be missing. This data did not come from Yahoo's historical data download service, as they adjust the prices for splits and merges. The prices (as far as I can tell) are the actual ticker prices at that point in time.
Tab-Delimited, File Format: <DATE, PRICE, VOLUME, OPEN, LOW, HIGH>