Authorities are investigating the cause of a Cary apartment fire late Wednesday night that displaced as many as 20 families.