This paper presents an algorithm based on stochastic dynamic programming framework for an online retailer who is to maximize his revenue by dual use of sponsored search advertising and dynamic pricing for a fixed inventory of a perishable product over a finite horizon. The available budget for advertising is limited over the planning horizon. As there is an interaction between bidding and pricing decisions, we provide an integrated advertising and pricing solution approach. First, we prove some properties of optimal policy. Second, according to the properties, we develop an efficient algorithm to solve large-scale instances. Finally, we conduct several numerical experiments to compare the proposed algorithm with an optimal approach which is presented in the form of a non-linear mathematical model. We observe that in all provided instances, the proposed algorithm reaches the optimal solution in far less time than the optimal approach. Additionally, we indicate the relationship between the run time of the presented approach and inventory level. In contrast with expectations, we find out that for a particular parameter setting, an increase in inventory level does not necessarily lead to an increase in the run time of the presented approach.