The most important variable is the current spot price. This is typically updated many times each minute throughout the day (the notable exception being on weekends, when the price is not changed). It is based on the price of futures contracts for the nearest delivery month. But if the spot price of silver is $15/ounce, you won't pay $15 for an ounce of silver.
Like all other businesses, dealers cannot sell to you for the same price that they buy something. In retail, this is called a markup (e.g. the store may pay $200 for a TV, and sell it to you for $250, resulting in a $50 markup). With precious metals, dealers typically buy from customers as well as sell to customers. The difference in price is called a 'spread'. So a dealer may have a 3% spread between their buy and sell prices (so if you buy something from them, and sell it back while the spot price is the same, you will lose 3% from the spread).
The next factor is premiums and discounts. If a dealer sells to you (or buys from you) above the spot price, the difference between the sell (or buy) price and spot is called the 'premium.' Alternatively, if they sell or buy below the spot price, the difference is called the 'discount.' The premium for some products is higher than for other products. For example, the premium for 1 ounce .999 fine coins is usually higher than for 1 ounce .999 fine medals (ones not produced by a government), and .999 fine coins/medals that weigh less than an ounce usually have a higher premium than those that weigh an ounce.
Another factor is fees (such as shipping, commissions, and taxes). Most 'brick and mortal' dealers do not charge any fees other than taxes (if applicable). Most online dealers charge shipping, but not tax. Some upscale dealers charge commissions (typically ones that have salespeople that call you occasionally).
So there you have it!