if we go for the less classic solutions (meteorites, comets, asteroids and so on) there isn't much we can actually predict.
Stuff coming from the sun usually comes without warning and it takes very little (compared to astronomic times) to reach earth.
Other things are:
1) not very visible until it's too late (Aliens? )
2) Visible enough that we can know it in advance (Comets or even incoming planets)
3) Too sudden (Solar Flares)
4) The information of the event comes with the event itself (Gamma Ray Bursts, which travel at the speed of light so you get a visual of the event at the same time of the damage being done)
An idea could be a Rogue Black Hole (yes, they are a thing): a black hole wandering around the universe and ends up in our solar system.
Since the black hole is not "eating" anything at the moment it's undetectable (It should be emitting Hawking Radiation though, but i don't think it's that much detectable, it should be very faint actually).
All of a sudden it gets close to Neptune with catastrophic results, and everyone is aware of that black hole now.
The black hole has now matter swirling around it (an accretion disk) and it would be very bright because of the heat emanated by the disk, probably it could even be seen with naked eye (it mostly depends on the disk size at this point. But we can safely assume it'd be easily visible at a certain point)
Now we have 2 scenarios, depending on the black hole size:
The black hole is very tiny and almost at the end of its life (we're talking the same order of magnitude of atoms, if not tinier. A black hole of $1*10^{-9}$ nanometers, way less than an hydrogen atom which is 0.053 nanometers, will have a 673468.0 metric tons mass and a lifespan of 813 years)
The black hole is big enough to influence other celestial bodies (a coin sized black hole will have roughly the same mass of the earth, so i think that'd be enough)
In the 1st case the black hole won't have a long life span but it can have a direct effect on the earth by evaporating next to it, emanating a lot of radiation. So our scientists might calculate that in a few years the black hole that perturbed Neptune will get close to the earth and end its life close to it exploding with terrible force, emanating gamma rays which will kill most of the life on earth
The 2nd case is more catastrophic. The black hole can't reach the earth or it will completely destroy it.
The best course of action for a not-so-catastrophic catastrophe would be if it hit mars and then the debris would hit the earth or if it passed so close to the earth to perturb its orbit causing earthquakes and possibly a new ice age, or even move the earth closer to the sun (and/or tilt its axis) and make it hotter. In any case this will do a lot of damage to the current life on earth
This video might give you an idea on how catastrophic a coin sized black hole is (and also how a very tiny black hole might "affect" life on earth on evaporation): https://www.youtube.com/watch?v=8nHBGFKLHZQ
I haven't said anything about the black hole's speed but that can be arbitrarily set to suit your needs (depending on how much "sciency" you want to go, you might need to do some calculations). Just remember that you need to make it go quite fast to not be caught by the sun's or other planets gravitational field, becoming part of the solar system and ending up in a stable orbit before unleashing its wrath on the earth
Also remember: Black holes do not suck things! they have a huge gravity pull but no bigger than the thing they formed from. If the sun would instantly turn into a black hole, planets would still have the same orbit (well, we would die because of no more heat but that's not important). The only difference would be in the area which was previously occupied by the sun, that's the point where a black hole's curvature of space time (which is its "gravity") does the weird things. This is just to say that what i wrote is kinda plausible with today's knowledge of black holes.
More on Black Holes lifespan:
https://www.quora.com/How-long-does-a-black-hole-last
Black Hole features calculator:
http://xaonon.dyndns.org/hawking/