PRE-REGISTRATION ELIGIBILITY CRITERIA (ALL PATIENTS) • Tissue available for biomarker testing (any brain metastasis tissue and extracranial site from any prior resection or biopsy).
REGISTRATION ELIGIBILITY CRITERIA (ALL PATIENTS)
* Participants must have histologically confirmed parenchymal metastatic disease to the brain from any solid tumor. Note: this includes patients that have controlled extracranial disease with progressive intracranial metastasis, as well as patients that have progressive intracranial and extracranial disease.
* New or progressive brain metastases are defined as any one of the following:
* Untreated measurable lesions in patients who have received surgery and/or stereotactic radiosurgery (SRS) to one or more other lesions.
* Progressive measurable lesions after radiation, surgery, or prior systemic therapy
* Residual or progressive lesions after surgery if asymptomatic.
* Patients who have had prior whole-brain radiotherapy (WBRT) and/or SRS and then whose lesions have progressed by BM-RANO criteria or there are new lesions, are eligible. Lesions treated with SRS may be eligible if there is unequivocal evidence of progression. For patients with NTRK or ROS1 mutations, entrectinib may be used for newly diagnosed brain metastases.
* Patients who have not previously been treated with cranial radiation (e.g. WBRT or SRS) are eligible, but such patients must be asymptomatic or neurologically stable from their CNS metastases.
* Measurable CNS disease (=\> 10 mm).
* Ability to obtain magnetic resonance imaging (MRI)s with contrast
* No surgery within 2 weeks prior to or after registration.
* No chemotherapy within 14 days prior to registration (Note: for abemaciclib arm, a 21-day chemotherapy washout is required).
* For melanoma, patients must have progressed after prior immune checkpoint blockade or for BRAF positive melanoma, BRAF/MEK inhibitors.
* For lung cancer, EGFR mutant patients must have failed EGFR therapies
* For HER2-positive breast cancer patients (regardless of ER/PR status), patients must have received at least one prior HER-2 directed therapy in the metastatic setting.
* For triple negative breast cancer (TNBC), patients must have received at least one chemotherapy in the metastatic setting.
* For estrogen receptor (ER) and/or progesterone receptor (PR)+ HER2-negative breast cancer, patients must have received at least one endocrine therapy in the metastatic setting.
* Patients who have received prior treatment with any of the targeted treatments on this study are not eligible for that specific treatment arm(s), but could be eligible for other arms (e.g., a patient who has had prior treatment with abemaciclib would not be eligible for the abemaciclib arm, but could be eligible for another arm).
* Presence of clinically actionable alteration in NTRK, ROS1, or CDK pathway or PI3K pathway in both a brain metastasis and extracranial site per central review.
* Not pregnant and not nursing, because this study involves investigational agents whose genotoxic, mutagenic and teratogenic effects on the developing fetus and newborn are unknown. Therefore, for women of childbearing potential only, a negative pregnancy test done =\< 14 days prior to registration is required (Note: for abemaciclib arm, pregnancy test is required =\< 7 days prior to registration).
* No known current diffuse leptomeningeal involvement (diffuse defined as leptomeningeal involvement throughout the CNS axis; if there is documented positive CSF cytology, patient is ineligible).
* Eastern Cooperative Oncology Group (ECOG) performance status 0-2.
* Adequate organ function.
* Absolute neutrophil count (ANC) \>= 1,500/mm\^3.
* Platelet count \>= 100,000/mm\^3.
* Total bilirubin =\< 1.5 x upper limit of normal (ULN) except in patients with Gilbert's disease. Patients with Gilbert's syndrome with a total bilirubin ≤2.0 times ULN and direct bilirubin within normal limits are permitted.
* Aspartate aminotransferase (AST) and alanine aminotransferase (ALT) =\< 2.5 x upper limit of normal (ULN).
* Creatinine =\< 1.5 mg/dL OR calculated (Calc.) creatinine clearance \> 45 mL/min.
* No uncontrolled medical comorbidities per investigator discretion (e.g. interstitial lung disease, severe dyspnea at rest or requiring oxygen therapy, severe renal impairment \[e.g. estimated creatinine clearance \<30ml/min\], history of major surgical resection involving the stomach or small bowel, or preexisting Crohn's disease or ulcerative colitis or a preexisting chronic condition resulting in baseline Grade 2 or higher diarrhea)
* Radiation to symptomatic non-target sites within neural axis is allowed prior to registration without washout (provided there is at least one untreated target lesion for measurement on study and radiation is completed prior to registration).
* Concurrent systemic corticosteroids are allowed if stable dose of dexamethasone for 7 days prior to registration. Baseline doses and changes in steroid dosing will be captured.
* No concurrent administration of anticancer therapies (except for endocrine therapy or continuation of hormonal therapy or trastuzumab in breast cancer patients). No chemotherapy, targeted therapy or immunotherapy within 14 days prior to entering the study (Note: For abemaciclib arm, a 21-day chemotherapy washout is required).
* Chronic concomitant treatment with strong inhibitors of CYP3A4 is not allowed on this study. Patients on strong CYP3A4 inhibitors must discontinue the drug 14 days prior to registration on the study.
* Chronic concomitant treatment with strong CYP3A4 inducers is not allowed. Patients must discontinue the drug 14 days prior to the start of study treatment.
ADDITIONAL REGISTRATION ELIGIBILITY CRITERIA FOR PAXALISIB ARM
* Urine protein to creatinine (UPC) ratio \< 1 or urine protein =\< 1.
* Recent acute myocardial infarction in the last 6 months or current angina pectoris are excluded. Patients with symptomatic bradycardia should have an electrocardiogram at baseline. If QT interval \> 470 msec, the patient is excluded.
* Patients with uncontrolled type I or II diabetes mellitus should be excluded. Uncontrolled diabetes is defined as glycosylated hemoglobin (HbA1c) \> 9% in addition to fasting glucose \> 140 mg/dL on at least 2 occasions within 14 days prior to registration.
ADDITIONAL REGISTRATION ELIGIBILITY CRITERION FOR ENTRECTINIB ARM
• Concurrent use of H2 receptor antagonists, receptor antagonists, proton pump inhibitors (PPIs), and/or antacids are prohibited.
ADDITIONAL REGISTRATION ELIGIBILITY CRITERION FOR ABEMACICLIB ARM
* Hemoglobin \>= g/dL. Patients may receive erythrocyte transfusions to achieve this hemoglobin level at the discretion of the investigator. Initial treatment must not begin earlier than the day after the erythrocyte transfusion.
* Patients who received chemotherapy must have recovered (Common Terminology Criteria for Adverse Events \[CTCAE\] Grade ≤1) from the acute effects of chemotherapy except for residual alopecia or Grade 2 peripheral neuropathy prior to registration. A washout period of at least 21 days is required between last chemotherapy dose and registration (provided the patient did not receive radiotherapy).
* Patients who received adjuvant radiotherapy must have completed and fully recovered from the acute effects of radiotherapy. A washout period of at least 14 days is required between end of radiotherapy and registration.
* Breast cancer patients who have received ribociclib or palbociclib are eligible as long as there is documentation of CDK4/6 pathway alteration on a biopsy or resection at the point of progression post-ribociclib or palbociclib.
* For females of childbearing potential: A female of childbearing potential, must have a negative serum pregnancy test within 7 days prior to registration and agree to use a highly effective contraception method during the treatment period and for 3 weeks following the last dose of abemaciclib. Contraceptive methods may include an intrauterine device \[IUD\] or barrier method. If condoms are used as a barrier method, a spermicidal agent should be added as a double barrier protection. Cases of pregnancy that occur during maternal exposures to abemaciclib should be reported. If a patient or spouse/partner is determined to be pregnant following abemaciclib initiation, she must discontinue treatment immediately. Data on fetal outcome and breast-feeding are to be collected for regulatory reporting and drug safety evaluation.
* Patients with active bacterial infection (requiring intravenous \[IV\] antibiotics at time of initiating study treatment), fungal infection, or detectable viral infection (such as known human immunodeficiency virus positivity or with known active hepatitis B or C \[for example, hepatitis B surface antigen positive\] are excluded. Screening is not required for enrollment.
* Patients with personal history of any of the following conditions: syncope of cardiovascular etiology, ventricular arrhythmia of pathological origin (including, but not limited to, ventricular tachycardia and ventricular fibrillation), or sudden cardiac arrest, are excluded.