A 36-year-old man is in custody Thursday after police said he threw Molotov cocktails at two houses of worship in Queens.