Eligibility Criteria:
PHASE I
Inclusion Criteria (phase I):
* Women must not be pregnant or breastfeeding; breastfeeding must be discontinued or the subject is not eligible for the study
* All females of childbearing potential must have a blood test within 2 weeks prior to randomization to rule out pregnancy; a female of childbearing potential is any woman, regardless of sexual orientation or whether they have undergone tubal ligation, who meets the following criteria: 1) has not undergone a hysterectomy or bilateral oophorectomy; or 2) has not been naturally postmenopausal for at least 24 consecutive months (i.e., has had menses at any time in the preceding 24 consecutive months)
* Women of childbearing potential and sexually active males must be strongly advised to use an accepted and effective method of contraception
* Patients must have histologically or cytologically confirmed:
* Extensive stage small cell lung cancer (SCLC) or
* Stage IV (M1a or M1b according to American Joint Committee on Cancer \[AJCC\] Staging Manual, 7th edition) large cell neuroendocrine non-small cell lung cancer (NSCLC) or
* Small cell carcinoma of unknown primary or extrapulmonary origin and must be a candidate for systemic therapy
* NOTE: The extensive disease SCLC classification for this protocol includes all patients with disease sites not defined as limited stage; limited stage disease category includes patients with disease restricted to one hemithorax with regional lymph node metastases, including hilar, ipsilateral and contralateral mediastinal, and/or ipsilateral supraclavicular nodes; extensive disease patients are defined as those patients with extrathoracic metastatic disease, malignant pleural effusion, bilateral or contralateral supraclavicular adenopathy
* Patients must have measurable or non-measurable disease based on Response Evaluation Criteria in Solid Tumors (RECIST) 1.1; baseline measurements and evaluations of all sites of disease must be obtained =\< 4 weeks prior to registration (Phase I)
* Eastern Cooperative Oncology Group (ECOG) performance status 0 or 1
* Absolute neutrophil count \>= 1,500/mm\^3
* Platelets \>= 100,000/mm\^3
* Leukocytes \>= 3,000/mm\^3
* Hemoglobin \>= 9 g/dL
* Total bilirubin =\< 1.5 times institutional upper limit of normal (ULN)
* Aspartate aminotransferase (AST) (serum glutamic oxaloacetic transaminase \[SGOT\]) and alanine aminotransferase (ALT) (serum glutamate pyruvate transaminase\[SGPT\]) =\< 3 times institutional ULN (=\< 5 times if liver function test \[LFT\] elevations due to known liver metastases)
* Creatinine =\< 1.5 X ULN OR creatinine clearance \>= 60 mL/min/1.73 m\^2 for patients with creatinine levels \> 1.5 x ULN
* Patients with central nervous system (CNS) metastases or a history of CNS metastases are ineligible
* Patients cannot have had prior chemotherapy or biologic therapy for SCLC or large cell neuroendocrine NSCLC, or small cell carcinoma of unknown primary or extrapulmonary origin; patients receiving prior radiation cannot register within 7 days after completion of radiation, and must have resolved adverse events attributed to radiation to =\< grade 1; no previous irradiation to the only site of measurable or evaluable disease, unless that site had subsequent evidence of progression
* Patients receiving prior radiation cannot register within 7 days after completion of radiation, and must have resolved adverse events attributed to radiation to =\< grade 1; no previous irradiation to the only site of measurable or evaluable disease, unless that site had subsequent evidence of progression
* Patients must NOT have uncontrolled intercurrent illness including, but not limited to, ongoing or active infection, symptomatic congestive heart failure, unstable angina pectoris, uncontrolled cardiac arrhythmia, or psychiatric illness/social situations that would limit compliance with study requirements
* Human immunodeficiency virus (HIV)-positive patients on combination antiretroviral therapy are ineligible
* Patient must be able to swallow pills
Exclusion Criteria (phase I):
* Patients have active seizure(s) or history of seizure(s)
* Patients have history of allergic reactions attributed to compounds of similar chemical or biologic composition to veliparib or other agents used in the study
PHASE II
Inclusion Criteria (phase II):
* Women must not be pregnant or breastfeeding; breastfeeding must be discontinued or the subject is not eligible for the study
* All females of childbearing potential must have a blood test within 2 weeks prior to randomization to rule out pregnancy; a female of childbearing potential is any woman, regardless of sexual orientation or whether they have undergone tubal ligation, who meets the following criteria: 1) has not undergone a hysterectomy or bilateral oophorectomy; or 2) has not been naturally postmenopausal for at least 24 consecutive months (i.e., has had menses at any time in the preceding 24 consecutive months) with the current month counted as month 1
* Women of childbearing potential and sexually active males must be strongly advised to use an accepted and effective method of contraception
* Patients must have extensive stage, histologically or cytologically confirmed small cell lung cancer; NOTE: the extensive disease classification for this protocol includes all patients with disease sites not defined as limited stage; limited stage disease category includes patients with disease restricted to one hemithorax with regional lymph node metastases, including hilar, ipsilateral and contralateral mediastinal, and/or ipsilateral supraclavicular nodes; extensive disease patients are defined as those patients with extrathoracic metastatic disease, malignant pleural effusion, bilateral or contralateral supraclavicular adenopathy
* Patients must have measurable disease based on RECIST 1.1; baseline measurements and evaluations of all sites of disease must be obtained =\< 4 weeks prior to registration
* ECOG performance status 0 or 1
* Absolute neutrophil count \>= 1,500/mm\^3
* Platelets \>= 100,000/mm\^3
* Leukocytes \>= 3,000/mm\^3
* Hemoglobin \>= 9 g/dL
* Total bilirubin =\< 1.5 times institutional upper limit of normal (ULN)
* AST (SGOT) and ALT (SGPT) =\< 3 times institutional ULN (=\< 5 times if LFT elevations due to known liver metastases)
* Creatinine =\< 1.5 X ULN OR creatinine clearance \>= 60 mL/min/1.73 m\^2 for patients with creatinine levels \> 1.5 x ULN
* Patients cannot have had prior chemotherapy or biologic therapy for small cell lung cancer; patients receiving prior radiation cannot register within 7 days after completion of radiation, and must have resolved adverse events attributed to radiation to =\< grade 1; no previous irradiation to the only site of measurable or evaluable disease, unless that site had subsequent evidence of progression
* Patient must be able to swallow pills
* Patients may not be receiving any other investigational agents while on study
Exclusion Criteria (phase II):
* Patients with CNS metastases or a history of CNS metastases are ineligible
* Patients have history of allergic reactions attributed to compounds of similar chemical or biologic composition to veliparib or other agents used in the study
* Patients have active seizure(s) or history of seizure(s)
* Patients must NOT have uncontrolled intercurrent illness including, but not limited to, ongoing or active infection, symptomatic congestive heart failure, unstable angina pectoris, uncontrolled cardiac arrhythmia, or psychiatric illness/social situations that would limit compliance with study requirements
* HIV-positive patients on combination antiretroviral therapy are ineligible because of the potential for pharmacokinetic interactions with veliparib; in addition, these patients are at increased risk of lethal infections when treated with marrow-suppressive therapy; appropriate studies will be undertaken in patients receiving combination antiretroviral therapy when indicated