A method for preparing a sprayed solid dispersion, comprising: combining an active agent, a dispersion polymer, an amount of ammonia, and a solvent to form a spray solution, wherein the solvent comprises a C 1 -C 3 alkanol, the active agent, in a free acid form, has a pKa ≤ 7 and a solubility ≤ 40 mg/mL in the solvent selected from methanol, ethanol, n-propanol, and/or isopropanol at a temperature of 20-25°C, and the amount of ammonia is sufficient to solubilize the active agent in the solvent, said ammonia being present in an amount of: - at least 0.95 molar equivalents relative to a sum of acid groups on the active agent; or - at least 0.95 molar equivalents relative to a sum of acid groups on the active agent and any acid groups on the dispersion polymer; or - from 0.95 to 10 molar equivalents relative to a sum of acid groups on the active agent and any acid groups on the dispersion polymer; or - at least 0.95 molar equivalents relative to a sum of acid groups on an amount of the active agent that exceeds the free acid form solubility of the active agent in the solvent and any acid groups on the dispersion polymer; spraying the spray solution to form a sprayed solid dispersion comprising the active agent, the dispersion polymer, and ammonia; and removing residual ammonia from the sprayed solid dispersion to form a product comprising a solid dispersion of the active agent and the dispersion polymer, the product comprising ≤ 500 ppm ammonia wherein removing residual ammonia comprises heating the sprayed solid dispersion at a temperature within a range of 30-70 °C and a relative humidity within a range of 10-75% for 2 to 60 hours to form the product comprising ≤ 500 ppm ammonia. combining an active agent, a dispersion polymer, an amount of ammonia, and a solvent to form a spray solution, wherein the solvent comprises a C 1 -C 3 alkanol, the active agent, in a free acid form, has a pKa ≤ 7 and a solubility ≤ 40 mg/mL in the solvent selected from methanol, ethanol, n-propanol, and/or isopropanol at a temperature of 20-25°C, and the amount of ammonia is sufficient to solubilize the active agent in the solvent, said ammonia being present in an amount of: - at least 0.95 molar equivalents relative to a sum of acid groups on the active agent; or - at least 0.95 molar equivalents relative to a sum of acid groups on the active agent and any acid groups on the dispersion polymer; or - from 0.95 to 10 molar equivalents relative to a sum of acid groups on the active agent and any acid groups on the dispersion polymer; or - at least 0.95 molar equivalents relative to a sum of acid groups on an amount of the active agent that exceeds the free acid form solubility of the active agent in the solvent and any acid groups on the dispersion polymer; the solvent comprises a C 1 -C 3 alkanol, the active agent, in a free acid form, has a pKa ≤ 7 and a solubility ≤ 40 mg/mL in the solvent selected from methanol, ethanol, n-propanol, and/or isopropanol at a temperature of 20-25°C, and the amount of ammonia is sufficient to solubilize the active agent in the solvent, said ammonia being present in an amount of: - at least 0.95 molar equivalents relative to a sum of acid groups on the active agent; or - at least 0.95 molar equivalents relative to a sum of acid groups on the active agent and any acid groups on the dispersion polymer; or - from 0.95 to 10 molar equivalents relative to a sum of acid groups on the active agent and any acid groups on the dispersion polymer; or - at least 0.95 molar equivalents relative to a sum of acid groups on an amount of the active agent that exceeds the free acid form solubility of the active agent in the solvent and any acid groups on the dispersion polymer; - at least 0.95 molar equivalents relative to a sum of acid groups on the active agent; or - at least 0.95 molar equivalents relative to a sum of acid groups on the active agent and any acid groups on the dispersion polymer; or - from 0.95 to 10 molar equivalents relative to a sum of acid groups on the active agent and any acid groups on the dispersion polymer; or - at least 0.95 molar equivalents relative to a sum of acid groups on an amount of the active agent that exceeds the free acid form solubility of the active agent in the solvent and any acid groups on the dispersion polymer; spraying the spray solution to form a sprayed solid dispersion comprising the active agent, the dispersion polymer, and ammonia; and removing residual ammonia from the sprayed solid dispersion to form a product comprising a solid dispersion of the active agent and the dispersion polymer, the product comprising ≤ 500 ppm ammonia wherein removing residual ammonia comprises heating the sprayed solid dispersion at a temperature within a range of 30-70 °C and a relative humidity within a range of 10-75% for 2 to 60 hours to form the product comprising ≤ 500 ppm ammonia.