Raw carbon fiber is made from either polyacrylonitrile (PAN) or a petroleum pitch precursor. Rayon was used prior to the development of PAN. These fossil-fuel- based materials come from either petroleum refining or natural gas processing. Alternative, potentially far cheaper, and even biobased precursors are under development.
Flake C. Campbell, Jr. 2004. Manufacturing processes for advanced composites. vol. 13. Elsevier. link