Company directories may be available in print and/or in databases. In addition to searching by the desired company name, some may allow you to search by geography, industry codes--e.g., SIC, NAICS codes and industry or product categories. Keep in mind that many directories are not comprehensive, i.e., including every company in a given category or region. You may have to use a combination of directories--both online and print, depending on your needs.
Many industry-specific trade magazines will publish company directories and or rankings for the industries they cover. Forbes and Fortune magazines publish lists. Forbes, for example lists "America's Largest Private Companies" on their website. Best's Review has special lists of insurance companies/brokers in various issues. Fortune's website will provide a variety of rankings. Inc. magazine has their annual ranking of the fastest-growing private companies in America.
For rankings of companies by different categories: