The sphere of fire from the flaming sphere spell is only 5 feet wide. So on a grid with 5-foot squares, it would affect a 3×3 area, with the sphere in the middle square. For ramming, the spell specifically says:
If you ram the sphere into a creature, that creature must make the saving throw against the sphere’s damage, and the sphere stops moving this turn.
This means you use your command of the sphere to move it directly into a creature's space (thereby hitting it) and they have to make a normal Dex save, and if the sphere hits the target before moving its full 30 feet you lose the rest of the move distance.
I think there are several interpretations, with no definitive rules support one way or another, so it's dm judgement call.
No, flaming sphere stays lit, and pyrotechnics causes the fireworks or smoke
The flaming sphere stays lit and you get the fireworks/smoke.
The reason the sphere stays lit is that it is fueled by magic, not mundane fuel.
While there isn't explicit rules support for this interpretation, it isn't unbalanced because it isn't more powerful than the spells separately, and deciding in favor of the PCs and the rule of cool argue in favor of it.
Perhaps for fluff it goes out during the fireworks/smoke, then relights.
A Contrary Argument
A contrary argument would be that you get either spell, but not both. Basically either one spell or the other wins.
If pyrotechnics wins, then the flaming sphere is extinguished and you get your choice of the fireworks or smoke.
If flaming sphere wins, then pyrotechnics fails to extinguish the flame.
This is making the assumption that the fire in the flaming sphere is magically fueled for the duration, and it seems reasonable to assume that it can't be snuffed the same way as a regular fire, because magic.
So how to decide which spell wins? Assuming they're both cast by the same caster, it seems reasonable to let the caster choose. If cast by different casters in an antagonistic situation, if the spells have been cast at different levels, higher level wins; otherwise, its a contest between spellcasting abilities.
No matter what, the fires created by the flaming sphere are fair game
You can use the flaming sphere to ignite something, and then use pyrotechnics to blow that stuff up like a boss, or, create smoke, of course.
Again, there's not much in the way of rules support, but if you think allowing the sphere to stay lit is overpowered, then perhaps this is the way to go.
Note:
My original answer was significantly different from this but editing it made me re-think it.
Best Answer
GM ruling covers this: line of sight may be obscured
The rules don't specify whether the flaming sphere opaque or not, but there are some rules that can help the DM make a ruling on this situation (italic emphasis mine):
Making an Attack (SRD p. 94):
The GM makes a ruling on cover (yes/no) and how much cover(half, 3/4, total). What is available to assist in making this ruling? Cover and Vision rules offer some help.
Cover (p. 96 SRD):
But the fire isn't solid, is it? (Neither is a portcullis, but I digress). You could shoot through the fire if you see some of the target behind there. But is there a penalty to the shot, since you can't see the whole target?
Look at the situation and decide if the flaming sphere provides some, a lot, total, or no cover.
It will depend on the situation. In a 5' wide hallway, you could make the case for 1/2 cover, while in a large room where a Ranger can step to either side there may be no cover at all.
Why "cover" from a non-solid object?
Obscured vision. Is the target partly obscured by this big old ball of fire?
Vision and Light (SRD p. 86):
Foliage isn't opaque, per se, but it can certainly obstruct vision. You could consider the flaming sphere something like a burning bush: if not opaque, certainly an obstruction to vision.
Combine "obscured" with "cover" and you can make a good case for 1/2 cover in a situation where the Ranger can't move to get a clearer look at the target. I'd have a harder time arguing 3/4 cover or total, since the flame isn't a solid object.
Make a ruling, and play on!