One thing that is kind of interesting is that drug company research cost is pretty low. They would rather focus on development than pure research if given the opportunity. Research is a huge expense so they let research find targets, let biotech establish the target as a legitimate drug opportunity, and then partner with biotech to get it to market. However, biotech usually only has a biologic solution like a monoclonal antibody. That's great because it gets to the market quickly, but it isn't a great solution because the COGS are extremely high for monoclonal antibodies, and patients would rather take a pill than get an infusion. So, while the monoclonal is on the market, pharma will use its huge bank of chemical libraries and see if it can find a hit. Then, it will optimize any hit through combinatorial libraries which are similar in structure to the hit.
So, pharma doesn't waste much money on basic research but it pours a shit-ton of money into development (which includes clinical trials). Still, pharma spends a ton of money on marketing. As a consultant (20yrs ago), I saw that the best correlation to sales was the number of papers on a drug. Sales force size, advertising budgets, medical science liaisons, etc. weren't well correlated. So, I worked to get pharma on board with getting papers out there. It is interesting though, how much pharma still focuses on sales. I have a buddy who is heavily involved with Dupixent (a monoclonal antibody with high COGS) and sales on such a drug is more about helping get patient insurance to pay for the product. Cost without insurance and discount cards is about $5000/mo or $60,000/yr. so it makes since to get a sales rep to help individual patients get the drug. So, the sales rep is helping the doctor write the letters to insurance and he is helping patients get a drug which they need and spending less time convincing the doctor to prescribe it.