Shares of pharmaceutical companies were trading firm in an otherwise subdued market, with Nifty Pharma index gaining nearly 1 per cent on the National Stock Exchange (NSE) on Wednesday, on expectation of improved outlook.