A fire that ripped through a north Raleigh townhouse complex Thursday was caused by "carelessly discarded smoking material," authorities said Friday afternoon.