Of the various medicines available for osteoporosis, the endocrinologist can decide the best choice based on the risk of fractures for the patient, the BMD, age, cause for osteoporosis and safety of the medicines.
This will be an informed decision made in discussion with you. In general, your doctor will use medicines that add bone when you have very poor BMD or you have had fractures in the past. This includes medicines like Teriparatide. Otherwise he may use drug classes like bisphosphonates or denosumab. Sometimes, the doctor may use a combination of drugs.