CIO - Understands the _business_ information needs of the company, customers, suppliers, management (at all levels), and stockholders. These are the _stakeholders_ of the corporation's operations - and might be extended to also include government (local, state, national) and even the public. Directs the (re-) architecting of company information domains and business processes (sales, operations, supply chain, financial, human resources, etc...). Deals with information needs and business processes, but not information technology architectures, per se. Works with the CEO/President on business models and vision issues, and collaborates with business VPs to learn their needs and develop new concepts. Works with the CTO to design appropriate systems. The CIO is a _business_ person with IT experience.
CTO - Understands current technology alternatives and capabilities, including strengths/weaknesses and tradeoffs of various choices in the hierarchy of applications, databases, transactional systems, operating systems, networking, platforms... other hardware. Takes direction on business needs from the CIO (or CEO/President, if there isn't a CIO), and plans for technology evolution of the company systems. The CTO is a _technology_ person having some familiarity with the company business model.
It's a division of responsibilities proceeding from CIO overloads in the early '90s. (CIOs came first, recently supplemented by CTO positions.)